1.

Solve : Issuue with nawk and split?

Answer»

Hi


using nawk with split does not WORK as expected.

I am trying to manipulate the following line field 5 using " ," as field separator.

Thu Mar 1 08:04:17 2012 , 6759, 9.56, 10.39, 10.05 08:04:18 ,1497 1489 sleeping, 8  jpl 128E , 58E free, 64E taken, 438E

nawk  -F"," 'BEGIN{split($5, now, " "); print now[0];now[1];now[2]}' "text_file"

with hope of retrieving 10.05 08:04:18 which I then need to reformat as 10.05, 08:04:18.
Which then gives me the required columns
finally SAVED to a new file as

Thu Mar 1 08:04:17 2012 , 6759, 9.56, 10.39, 10.05, 08:04:18 ,1497 1489 sleeping, 8  jpl 128E , 58E free, 64E taken, 438E

Any tips will be very much appreciated.

Thanks
naisidthe

nawk?  What operating system is this?  Which distribution?



Discussion

No Comment Found