All,
I have a field in a comma seperated file with hundreds of lines and about 20 columns and I wish to remove all numbers after the decimal point in field 4 on each line and output the rest to another file or write it back to itself.
Thanks for your help but I get the following error when I run the nawk version on solaris. In this case I am editing field 13 and not 4 as stated in the example.
nawk: syntax error at source line 1
context is
{sub("\.[0-9]+$", "", >>> $13; <<<
nawk: illegal statement at source line 1
missing )
That looks good however it seems to have deleted the lines where the field had 0.0 as its value. Which in this file means I have lost about 60000 rows out of 980000