Hallo,
I have a text file that looks something like this:
309;253;88554;10765;191
277;248;119721;6729;201
Using an awk script, I insert yesterdays date in front of every line. Yseterdays date is a variable called yesterday.
nawk -v yesterday="$day" -f a.awk file.txt file.txt
###a.awk
{ printf yesterday ; for (i=1; i<=NF; i++) printf("%s", $i); print ""}
Is there a way to modify this so that I insert that date after the first semi-colon? So it looks like this:
309;date;253;88554;10765;191
277;date;248;119721;6729;201
Any help much appreciated.
I have a text file that looks something like this:
309;253;88554;10765;191
277;248;119721;6729;201
Using an awk script, I insert yesterdays date in front of every line. Yseterdays date is a variable called yesterday.
nawk -v yesterday="$day" -f a.awk file.txt file.txt
###a.awk
{ printf yesterday ; for (i=1; i<=NF; i++) printf("%s", $i); print ""}
Is there a way to modify this so that I insert that date after the first semi-colon? So it looks like this:
309;date;253;88554;10765;191
277;date;248;119721;6729;201
Any help much appreciated.