Awk: how to have backclashes in printf?

Posted by HH on Stack Overflow See other posts from Stack Overflow or by HH
Published on 2010-04-15T04:44:49Z Indexed on 2010/04/15 5:03 UTC
Read the original article Hit count: 396

Filed under:
|
|
|

Works:

awk '{print $$1"\t&\t"$$2"\t\\\\"}' .file > file.tex

Does not work, why?

awk '{printf %.2f"\t&\t"\.2f"\t\\\\",$$1,$$2}' .file > file.tex

Error:

awk: {printf %.2f"\t&\t"\.2f"\t\\\\",$1,$2}
awk:                    ^ backslash not last character on line

© Stack Overflow or respective owner

Related posts about awk

Related posts about beginner