System (awk) command saved as a variables error

I am having the following error:

a <- system("awk '{ if (/foo/) print "2","\t",$0; else print "1","\t",$0; }' file",intern=true)

However, I am getting the following error:

Error: unexpected numeric constant in "a \<- system("awk '{ if (/foo/) print "2"

I am wondering if I have to escape the internal apostrophe's but not sure how?!



Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept