1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
awk -F";" '
{
if (NR == 1) {
StartTimeMinutes=(60*substr($7,1,2))+substr($7,4,2)
StartTime=$7
StartDay=substr($6,1,2)
next
}
EndTimeMinutes=(60*substr($5,1,2))+substr($5,4,2)
EndTime=$5
EndDay=substr($4,1,2)
Delta=(((StartDay - EndDay)*24*60) + StartTimeMinutes) - EndTimeMinutes
if (Delta > 120) {
print "StartTime : le "StartDay" à "StartTime" / EndTime : le ("EndDay") à "EndTime
}
StartTimeMinutes=(60*substr($7,1,2))+substr($7,4,2)
StartTime=$7
StartDay=substr($6,1,2)
} ' test.txt |
Partager