Calculate difference in timestamps based on unique column value

view story

http://www.unix.com – Hi Friends, Require a quick help to write the difference between 2 timestamps based on a unique column value: Input file: Code: 08/23/2012 12:36:09,JOB_5340,08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350,08/23/2012 12:36:26,JOB_5350 08/23/2012 13:08:51,JOB_5360,08/23/2012 13:08:58,JOB_5360 Output Required: Code: 08/23/2012 12:36:14,08/23/2012 12:36:09,00:00:05,JOB_5340 08/23/2012 12:36:26,08/23/2012 12:36:22,00:00:04,JOB_5350 08/23/2012 13:08:51,08/23/2012 13:08:58,00:00:07,JOB_5360 I'm using ksh on AIX machine, and the ksh version is Version M-11/16/88f Many Thanks NK (HowTos)