have a datafile that contains:
Jun 13 12:59:21
Jun 13 13:02:04
Jun 13 13:14:21
i want to parse this so they look like this:
Jun 13 12:59
Jun 13 13:02
Jun 13 13:14
how can i do this? basically wanna get rid of the seconds.
i'd prefer this to be a one liner.
command | awk blah blah
shell: bash
methyl
3
Please post sample data for a single digit day.
the date format is exactly the same as that of the unix messages file.
meaning:
Jun 8 13:02:04
Jun 10 14:05:98
notice the two spaces in the single digit date
cabrao
6
$ awk -F: 'sub(FS $NF,z)' file
Jun 13 12:59
Jun 13 13:02
Jun 13 13:14
1 Like