i have a huge log file in that format:
202.32.92.47,01/Jun/1995:00:00:59,/~scottp/publish.html,200,271
ix-or7-27.ix.netcom.com,01/Jun/1995:00:02:51,/~ladd/ostriches.html,200,205908
...
I need to calculate the difference in seconds between two lines from the first one to current. The second column is in format like this:
dd/month/year:HH:MM:SS
I can change it in vim using command:
:%s/\/Jun\//\:Jun\:/g
then i get:
fromkin.lib.uwm.edu,01:Jun:1995:11:58:03,/~scottp/publish.html,200,271
slip1.ac.brocku.ca,01:Jun:1995:11:58:03,/cgi-bin/hytelnet?file=DIR000,200,7748
bertram.hallf.lth.se,01:Jun:1995:11:58:06,/~macphed/finite/fe_resources/node92.html,200,1668
in format:
dd:month:year:HH:MM:SS
Is there any way to do it in shell scripts / awk ?
My expecting output is:
fromkin.lib.uwm.edu,01:Jun:1995:11:58:03,/~scottp/publish.html,200,271
slip1.ac.brocku.ca,0,/cgi-bin/hytelnet?file=DIR000,200,7748
bertram.hallf.lth.se,3,/~macphed/finite/fe_resources/node92.html,200,1668