Search the web
Sign In
New User? Sign Up
geeksthatgawk · for GNU Awk questions & discussions
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
mawk: print command with special characters?   Message List  
Reply | Forward Message #199 of 221 |
Hi,
can someone help me with this?
i want the print command to print a double quote mark as part of a
string. mawk won't have it. a double quote is a control character and
mawk will be damned if it's gonna let me treat it like a regular
character.

i wanna change this:

jack spratt could
eat no fat

to this:

jack " spratt could
eat " no fat

and i wanna do it on the command line. something like this:

mawk "{ print $1, [some expression that mawk will recognize as a
quote], $2, $3}" input.txt > output.txt

i've tried *everything*. \", \\", \\\", "\"", /\"/, \x22, "\x22" .....
any combination you could possibly think of. i've read whatever
references i could find. nothing works.

anybody out there who's been there and done that?

thanx, mike






Wed Jul 5, 2006 3:28 am

spillikinaer...
Online Now Online Now
Send Email Send Email

Forward
Message #199 of 221 |
Expand Messages Author Sort by Date

Hi, can someone help me with this? i want the print command to print a double quote mark as part of a string. mawk won't have it. a double quote is a control...
spillikinaerospace
spillikinaer...
Online Now Send Email
Jul 5, 2006
3:47 am

Might try a Single Quote ( ' ) or a backslash-Single Quote ( \' )... if that works you could use a Double Single Quote to give the illusion of a Double Quote...
Stout, Danny
dasthcc
Offline Send Email
Jul 5, 2006
2:18 pm

Try this (use \\\") gawk "BEGIN {print \"\\\"hello\\\"\"}" "hello" I tested it on Windows XP running win32 port gawk 3.1.3 from...
Ambrosio Berdijo
aberdijo
Offline Send Email
Jul 5, 2006
3:18 pm

... HASTA LA VISTA ***BABY*** that was my silver bullet! i tried variants on what you wrote and finally stumbled on the solution: i did: mawk "{print $1,...
spillikinaerospace
spillikinaer...
Online Now Send Email
Jul 6, 2006
12:16 pm

Mike... what would happen if you did a: gawk "{print 'word' }" or gawk "{print \"word\" }" (the idea being for the command line interpreter to know what double...
Stout, Danny
dasthcc
Offline Send Email
Jul 6, 2006
12:38 pm

... BINGO!!! that did the trick. i suppose with mawk there's just alot of guesswork involved. oh well, i got done what i wanted to get done. thanks Danny...
spillikinaerospace
spillikinaer...
Online Now Send Email
Jul 7, 2006
4:21 am

Kindly help me anybody!!!! how to create an index file? pleeeeeeeeeeeeeeeeeese Ambrosio Berdijo <aberdijo@...> wrote:...
ylng
naghems
Offline Send Email
Aug 6, 2006
12:37 pm

thanx, but no luck yet...
spillikinaerospace
spillikinaer...
Online Now Send Email
Jul 6, 2006
7:18 pm

Hi frenz How to create index file in gawk? am unable to do this...... If I use sorting and grepping it is taking lot of time. Please anybody help me. and do...
ylng
naghems
Offline Send Email
Jul 8, 2006
4:15 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help