advertisements
_____________________________________________________________________________________________________________________
This is my input file
cat dat
NO TAG20111217T004155
YES TAG20111217T004157
YES TAG20111217T004157
I want the output in following format
'TAG20111217T004155'
'TAG20111217T004157'
'TAG20111217T004157'
Method 1:
awk -v rep="'" '{ print q $2 q}' dat
TAG20111217T004155
TAG20111217T004157
TAG20111217T004157
Method 2:
awk -v rep="'" '{ print rep $2 rep}' dat
'TAG20111217T004155'
'TAG20111217T004157'
'TAG20111217T004157'
Method 3:
$ awk '{ print "'"'"'" $2 "'"'"'" }' dat
'TAG20111217T004155'
'TAG20111217T004157'
'TAG20111217T004157'
Method 4:
awk '{ print "'\''" $2 "'\''" }' dat
'TAG20111217T004155'
'TAG20111217T004157'
'TAG20111217T004157'
_____________________________________________________________________________________________________________________
0 comments:
Post a Comment