The UNIX and Linux Forums  
Hello and Welcome from to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-20-2007 01:52 AM
Print Problem in UNIX. Need to know the option to specify the print paper size ukarthik HP-UX 1 06-07-2007 10:35 AM
how to print part of report ? Golive HP-UX 2 06-22-2005 11:29 AM
How to "Print Screen" from a dumb terminal on AIX? stembe UNIX for Advanced & Expert Users 3 11-15-2002 12:01 PM
Print The ouput From ls | grep "!!!" geoquest UNIX for Advanced & Expert Users 5 04-11-2002 06:45 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-27-2006
LordJezo
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
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.
  #2 (permalink)  
Old 06-27-2006
x96riley3 x96riley3 is offline
Registered User
  
 

Join Date: Mar 2006
Location: Nashville
Posts: 79
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 (permalink)  
Old 06-27-2006
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
Try...
Code:
awk '{print $3 "\042" $4}'
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0