Why do I get the white space before and after the delimiter in the following example?
awk -F'^' '{print $1,":",$2}' SERVER_2012-02-29-12-15-00
3969 : 1272
3969 : 1272
3969 : 1272
I expect the results as below without any space:
3969:1272
3969:1272
3969:1272
The text file looks like this…
cat SERVER_2012-02-29-12-15-00
3969^1272^14.140.90.242^^IN^como^2012-02-29
3969^1272^14.140.90.242^^IN^como^2012-02-29
3969^1272^14.140.90.242^^IN^como^2012-02-29
This might work for you:
To concatenate the fields with a
:remove the,‘s.Or change the output field separator
OFSto null.