I have a file test.txt
with multiple records as below.
100,200,300,08-May-2012 11:24:25
100,400,300,25-May-2012 09:24:25
Now I want to output the data using the following "format":
$1,$2,$3,$4,$4+30days,$4+60days,$4+90days
How can I do that using awk
?
script.awk
fileThere's probably a better way to do the month abbreviation to number mapping; have at it. Using functions in
awk
is valuable just the same as it is in any other language with functions.Example
data
fileExample output
If you decide you want to handle switches in time zone differently, that's your prerogative; you can fix the code.