![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to extract first column with a specific character | selamba_warrior | Shell Programming and Scripting | 3 | 05-22-2008 05:14 AM |
| Escaping the * character in ksh. | arvindcgi | Shell Programming and Scripting | 6 | 05-19-2008 09:50 AM |
| [csh] checking for specific character ranges in a variable | userix | Shell Programming and Scripting | 5 | 05-11-2008 07:56 AM |
| How to change a specific character in a file | sdubey | Shell Programming and Scripting | 6 | 02-22-2008 03:30 PM |
| How to add character in specific position of a string? | victorlung | Shell Programming and Scripting | 5 | 09-01-2006 10:33 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hello there,
I have a bit of dirty delimited file, I mentioned dirty because, the delimiter can also appear in wrong positions. However, one uniqueness of this file is whenever the delimiter appear inside the double quote, then do not consider as delimiter, if it appear outside double then consider it as delimiter. contents looks like below abc;def;ghi;"kl;mn;op" ;qrst;uv;w;xyz; AWk inp=$1 nawk -F";" '{ print $1"~"$2"~"$3"~"$4"~"$5"~"$6"~"$7"~"$8; }' $inp >> ${inp}_det.txt gives me ouptut as abc ~def~ghi~"kl~mn~op" ~qrst~uv But expected output is abc ~def~ghi~"kl;mn;op" ~qrst~uv~w~xyz I'm kind of stuck how to escape the double quote . I appreciate any pointers. thanks |
|
||||
|
Hi,
To be more precise, all the fields are double quoted and delimited by semi colon ; something like: "abc";"def";"ghi";"kl;mn;op" ;"qrst";"uv";"w";"xyz"; I've preprocessed the files by removing all double quote & then noticed, probably that wouldn't work, as I need some sort of marker to tell that any values inside double quote is just value and not delimiter. Somhow struggling to press the right keys ![]() |
|
||||
|
Hi
I have a \ (backslash) as delimiter and i want a specific column from that. I have been unable to do that using either awk or sed Input tosattam123\mattasewq213 i want the Output mattasewq213 I have tried to escape the \ with / " ' and many other as well but to no avail can anybody help |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|