![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-19-2007 10:52 PM |
| Print Problem in UNIX. Need to know the option to specify the print paper size | ukarthik | HP-UX | 1 | 06-07-2007 06:35 AM |
| how to print part of report ? | Golive | HP-UX | 2 | 06-22-2005 07:29 AM |
| How to "Print Screen" from a dumb terminal on AIX? | stembe | UNIX for Advanced & Expert Users | 3 | 11-15-2002 09:01 AM |
| Print The ouput From ls | grep "!!!" | geoquest | UNIX for Advanced & Expert Users | 5 | 04-11-2002 02:45 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do I get awk to print a " in it's print part?
The line is simple, use "[" as a field separator for the bits. What I need to do is put a " between $2 and $3.
I can't seem to figure out the escape character needed to get awk to actually print out the " and not think it's part of a bigger double ". Any ideas? awk -F[ '{ print $1"["$2$3 }' file.txt| awk -F] '{ print $1"]"$2"\"$3THE " NEEDS TO GO HERE$4 }' I've tried \", "\, ^" and '"" but none of it works. What am I missing? Putting in the [ between $1 and $2 works fine, I just need to do the same with a ". Thanks. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
I'm not sure this is exactly what you wanted.
cat file | awk -F: '{print $1, $2, "\"", $3}' sybqad0l 1706 " 546 sybbev0x 6218 " 542 wpati0k 8145 " 253 wembi02 4621 " 267 pimdp01 223 " 133 abainn1 7098 " 1141 abaibm1 7094 " 1141 -X |
|
#3
|
||||
|
||||
|
Try...
Code:
awk '{print $3 "\042" $4}'
|
||||
| Google The UNIX and Linux Forums |