Say I have a file with 30 columns and I want to add 1 to the number in column 15, but otherwise print the line as is. Is there a better way to do this then something like
perl -lane' print "$F[0]\t$F[2]\t$F[3]....\t" .$F[15]+1 . "\t$F[16] .....\t$F[30]"' file.txtThe dots representing $Fx\t ( or everything in-between) Any ideas? the shorter the better. Also i was thinking maybe a tricky substation might work but this could get difficult with more complex operations. Still.... open to any suggestions Thanks for your time.
In reply to Editing just one column in a file by ZWcarp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |