hello,
I have a simple awk script thus:
egrep populateNode logfile.txt | gawk '{print $11}'
This gives me a list of usernames.
I want to pipe the above command into another command that will surround each username with an SQL insert statement:
insert into thetable (username) values ('username');
I'm trying to get awk to do this:
egrep populateNode logfile.txt | gawk '{print "insert into thetable (username) values ('" $11 "');"}'
but the apostophes around the username are killing the awk command
How can I output apostrophes within the "" ?? I've tried using \' - doesn't work ..
I'm using gawk on cygwin.
Regards
Tenakha