05-24-2011
~R in between string, how to handle in AWK
Hi,
Can any one help how to handle the below situation.
Am using Awk script to handle variable
When I open the file in VI mode, I see the string as Orange~Rs , but when I cat the file its showing as plain Oranges.
When I copied the file over to Windows, am seeing the special character as Orange's.
Am trying to assign it to a variable , and its giving me hard time and using it downstream in AWK, I tried both below formarts, using Octal replacement for apostraphe.
hdr == "Oranges"
hdr == "Orange\047s"
Can anyone help me with this.
Thanks
Sunil
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi ,
I am doing invert grep using -v but the string contain "/" which break the grep command and it do not skip the lines with "/" on it.
Diffu.txt
========
1159c1159
< <td align="right" valign="middle" class="paddingRight2px" id="featureListItemChannelButton7466">
---
> <td... (6 Replies)
Discussion started by: rajbal
6 Replies
2. UNIX for Dummies Questions & Answers
I trying to search for lines with multiple search criterias in an archive of zipped files. But awk seems to have a limit.
Any idea how to fix it?
I'm on a sun solaris system.
Here is my search string:
gzcat -r *200808* | awk -v 'substr($0,50,11)=="11095512309" ||... (3 Replies)
Discussion started by: HugoH
3 Replies
3. Shell Programming and Scripting
TEST_HEME,"SubNetwork=ONRM_RootMoR,SubNetwork=ARNC1",CELL
when I split by
FS=","
then
$0=TEST_HEME
$1="SubNetwork=ONRM_RootMoR
$2=SubNetwork=ARNC1"
but I need this will be single value
"SubNetwork=ONRM_RootMoR,SubNetwork=ARNC1" (4 Replies)
Discussion started by: Hemendra
4 Replies
4. Shell Programming and Scripting
Hi all,
I hope you guys can help me.
I prefer SED/AWK solutions if possible. For my shame it didn't work for me :o
ISSUE: :wall:
1\3
1/$4\@7\
1234567890123456789\
1234567890123456789,\
1234567890123456789\
123456789012
12345
1234567890123456789\
1234567890123456789,\
1234... (5 Replies)
Discussion started by: unknown7
5 Replies
5. UNIX for Dummies Questions & Answers
This question might be silly but its confusing me a bit:
What is the difference between handle to the thread HANDLE and thread identifier pthread_t?
---------- Post updated at 01:52 PM ---------- Previous update was at 01:48 PM ----------
Sorry I saw details and HANDLE is in windows and... (0 Replies)
Discussion started by: rupeshkp728
0 Replies
6. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
7. Shell Programming and Scripting
I am using below code to validate the source file,code working fine but if any column contains null value then below code throwing error actually it should not.how to customize the below code to handle null null values also.
When I run the script with below source data getting “date error”, as... (2 Replies)
Discussion started by: srivalli
2 Replies
8. Shell Programming and Scripting
Currently I am using this command to split a CSV file based on the distinct values in the 16th (position) column.
awk -F, 'NR==1 { hdr=$0; next } $16 != prev { prev=name=$16; gsub(/_]/,"",name); $0 = hdr "\n" $0 } { print > ("/Directory/File."name".Download.csv") }'... (3 Replies)
Discussion started by: lojkyelo
3 Replies
9. Shell Programming and Scripting
Hello Folks,
Need to bisect strings based on a subset.
Below works good.
echo /a/b/c/d | awk -F"/c/d$" '{print $1}'
/a/b
However, it goes awry with special characters.
echo /a/b/c+/d | awk -F"/c+/d$" '{print $1}'
/a/b/c+/d
Desired output:
/a/b
Escaping the special characters... (11 Replies)
Discussion started by: vibhor_agarwali
11 Replies
10. UNIX for Beginners Questions & Answers
Hi All
I am facing some issues while processing a file.
The file has \n as End Of Line. However for some records '\n' is also present as part of string. Hence I am not able to identify proper records from file.
File is # delimited.
Example:
2 rows spread across 4 lines.
line1: COL1#COL2#... (2 Replies)
Discussion started by: dashing201
2 Replies
LEARN ABOUT OPENDARWIN
set_color
set_color(1) fish set_color(1)
NAME
set_color - set_color - set the terminal color
set_color - set the terminal color
Synopsis
set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR]
Description
Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple,
cyan, white and normal.
o -b, --background Set the background color
o -c, --print-colors Prints a list of all valid color names
o -h, --help Display help message and exit
o -o, --bold Set bold or extra bright mode
o -u, --underline Set underlined mode
o -v, --version Display version and exit
Calling set_color normal will set the terminal color to whatever is the default color of the terminal.
Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey
font color, while set_color --bold white will result in a white font color.
Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator.
set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and
incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of
ncurses and recompile fish against it in order to fix this issue.
Version 1.23.1 Sun Jan 8 2012 set_color(1)