awk you can extract a
column of a file. Assume a file timesheet contains this:
hours spent on task y: 2 hours for task x: 3 task z: 4 hours for u: 5As you see each line contains a different number of fields. So to extract the last field you cannot use a fixed column number. But
awk sets the variable NF that you
can use like this:
$ awk '{print $NF}' timesheet
2
3
4
5
| Pete's Linux Advent Calendar 2008 | Comments? send mail to pkruse@arcor.de |
|