I have a log file in the form of a list of lists. The list is sorted by email address. Some log entries are partial duplicates, i.e. consecutive email addresses are the same, but login duration differs.
I want to compare each element of the list with the next in sequence to see if the email addresses are the same. If so, I want to sum the login duration, so that I end up with a list of unique email addresses and the total amount of time they were logged in.
I thought I could do this by using MapThread, having two copies of the list, and using ##1 and ##2, but I am doing something wrong.
I am sure that this type of "look ahead" function must be very obvious, but I can't quite work out how to do. Could someone point me in the right direction?
Cheers Andy