Determining time difference between two lines.
Posted on 2011-09-20
I have a very large file which shows when a site looses power and when that site powers-up again.
Each site has two lines - the first line shows when the site looses power and the second line shows when the site powers up again. Column D contains the timestamp when these events occur.
Can you tell me please what the code is which will show, in seconds, the outage time in column E. (Note: bear in mind that the outage may extend over a number of days therefore it's important to note the date part of the timestamp too)
A B C D
3713 Site A 15/09/2011 02:19:27 Event 1 at 2011-09-15 02:19:27.0 : Power down
3713 Site A 15/09/2011 02:19:42 Event 2 at 2011-09-15 02:19:42.0 : Power up
5397 Site B 15/09/2011 02:35:32 Event 1 at 2011-09-15 02:35:32.0 : Power down
5397 Site B 15/09/2011 02:36:12 Event 2 at 2011-09-15 02:36:12.0 : Power up