#!/bin/sh tr '\n' ' ' < "$1" | sed -e "s/'/'/g" -e 's/"/"/g' -e 's/>/-/g' -e 's/&/\&/g' -e 's/

:\n:g' | awk -F \" ' function print_time(t) { t /= 1000 h = int(t / 3600) m = int((t - 3600 * h) / 60) s = sprintf("%02.3f", t - 3600 * h - 60 * m) sub(/\./, ",", s) printf "%02d:%02d:%s", h, m, s } /^t=/ { print ++nb print_time($2) printf " --> " print_time($2 + $4) sub(/.*>/, "") print "\n" $0 "\n" }'