Awk: error in printf but not in print

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 4:53 UTC
Read the original article Hit count: 344

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