I'm sure this is simple and I've been looking at examples for days on end but can't seem to come to grips with awk. What I have:
Output is like so:
What I'm trying to achieve is the difference between chapter 1 start time and chapter 2 start time and so on subtracting each chapter start time from the next in the array e.g. 00:05:57 - 00:01:03 = 00:04:54
Starting with ghostdog74's example (which of course works perfectly) I have thus far been unable to make this work to subtract chapter start/end times. Perhaps someone can spot the reason(s)?
Finally it is working:
ChapStart is an array with start times in this format: 00:00:00 which gets converted to "Seconds since 1970-01-01"with 'date'. This allows us to do the math. Then, we convert it back to 00:00:00 format.