Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print single quote 1

Status
Not open for further replies.

AHinMaine

ISP
Nov 27, 2002
264
US
this is kicking my butt.... this shoudn't be so hard.

I've even been digging through the awk book and I can't figure it out.

how do I do this:

Code:
command | awk '{print $1",'"$2"'"}'

so that I can get the result:

Code:
field1,'field2'

Escaping it with a single, double, or triple backslashes doesn't work. Nothing I've tried works, for that matter. Can anyone help? --
Andy
 
Try..
[tt]
command | awk '{print $1 ",\047" $2 "\047" }'
[/tt]
 
command | nawk -v q="'" -v OFS="," '{print $1,q $2 q}' vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top