xargs removes single quotes after awk
Hi All,
my input is 111 222 333 i need to get '111','222','333' this is what i am doing more 1.out | awk -v q="'" '{ print q $1 q ","}' | xargs the last pipeline removes the single quotes tha i am adding with awk. so the result is 111,222,333 and not '111','222','333' How can this be fixed? Thank you |
Use
Code:
xargs -0 Code:
awk -v q="'" '{ print q $1 q ","}' 1.out | xargs -0 |
Quote:
thank you so much for your reply. Do you know how can i have all these variables in one line, one after the other separated by comma? |
Do you mean the content of the file entirely on one line as in your previous example? I'd do something like this:
Code:
$ cat testfile |
Quote:
|
All times are GMT -5. The time now is 04:34 PM. |