It's good....
but difference is not correct...the result is wrong:(
this is complete list of item:
10 17:54:47,213
10 17:54:47,214
10 17:54:49,338
10 17:54:49,399
10 17:54:50,402
10 17:54:50,403
11 17:54:47,213
11 17:54:47,213
11 17:54:49,362
11 17:54:49,422
11 17:54:50,429
11 17:54:50,429
11 17:54:50,429
11 17:54:50,429
11 17:54:51,510
12 17:54:47,213
12 17:54:47,214
12 17:54:49,311
12 17:54:49,383
12 17:54:50,379
12 17:54:50,380
12 17:54:50,380
12 17:54:50,380
12 17:54:51,460
24 18:30:01,405
24 18:30:01,406
24 18:30:03,122
24 18:30:03,122
24 18:30:03,122
24 18:30:03,122
24 18:30:04,213
25 18:30:01,406
25 18:30:01,406
25 18:30:03,124
25 18:30:03,124
25 18:30:03,124
25 18:30:03,124
25 18:30:04,214
26 18:30:01,406
26 18:30:01,406
26 18:30:03,122
26 18:30:03,122
26 18:30:03,122
26 18:30:03,122
26 18:30:04,202
29 18:30:01,407
29 18:30:01,407
29 18:30:03,142
29 18:30:03,142
29 18:30:03,142
29 18:30:03,142
29 18:30:04,223
31 18:30:01,407
31 18:30:01,407
31 18:30:03,072
31 18:30:03,072
31 18:30:03,072
31 18:30:03,072
31 18:30:04,153
40 21:19:31,946
40 21:19:31,946
40 21:19:33,297
40 21:19:33,297
40 21:19:33,297
40 21:19:33,297
40 21:19:34,388
41 21:19:31,946
41 21:19:31,946
41 21:19:33,297
41 21:19:33,297
41 21:19:33,297
41 21:19:33,297
41 21:19:34,388
42 21:19:31,947
42 21:19:31,947
42 21:19:33,296
42 21:19:33,296
42 21:19:33,296
42 21:19:33,296
42 21:19:34,376
45 21:19:31,947
45 21:19:31,947
45 21:19:33,315
45 21:19:33,315
45 21:19:33,315
45 21:19:33,315
45 21:19:34,395
46 21:19:31,947
46 21:19:31,947
46 21:19:34,108
46 21:19:34,108
46 21:19:34,108
46 21:19:34,108
46 21:19:35,188
56 21:49:32,076
56 21:49:32,076
56 21:49:33,868
56 21:49:33,868
56 21:49:33,868
56 21:49:33,868
56 21:49:34,958
57 21:49:32,076
57 21:49:32,076
57 21:49:33,869
57 21:49:33,869
57 21:49:33,869
57 21:49:33,869
57 21:49:34,959
58 21:49:32,076
58 21:49:32,076
58 21:49:33,865
58 21:49:33,865
58 21:49:33,865
58 21:49:33,865
58 21:49:34,946
59 21:49:32,077
59 21:49:32,077
59 21:49:33,886
59 21:49:33,886
59 21:49:33,886
59 21:49:33,886
59 21:49:35,476
61 21:49:32,077
61 21:49:32,077
61 21:49:33,820
61 21:49:33,820
61 21:49:33,820
61 21:49:33,820
61 21:49:34,900
8 17:54:47,213
8 17:54:47,213
8 17:54:49,340
8 17:54:49,410
8 17:54:55,803
8 17:54:55,803
9 17:54:47,213
9 17:54:47,213
9 17:54:49,341
9 17:54:49,430
9 17:54:55,869
9 17:54:55,869
---------- Post updated at 06:00 AM ---------- Previous update was at 05:43 AM ----------
With this code i receive this error:
awk: syntax error near line 1
awk: illegal statement near line 1
awk: syntax error near line 1
awk: illegal statement near line 1
for given input this will work
awk '
BEGIN {
m1 = "First occurrency of"
m2 = "Last occurrency of"
}
NR==1 || p!=$1{
print s ? m2 FS x FS ":" FS s RS m1 FS $1 ":" $0 : m1 FS $1 FS ":" FS $0
}
{
p=$1;s=$0; x=$1
}
END{
print m2 FS $1 ":" $0
}
' file
Resulting
First occurrency of 10 : 10 17:54:47,213
Last occurrency of 10 : 10 17:54:50,403
First occurrency of 11:11 17:54:47,213
Last occurrency of 11 : 11 17:54:51,510
First occurrency of 12:12 17:54:47,213
Last occurrency of 12 : 12 17:54:51,460
First occurrency of 24:24 18:30:01,405
Last occurrency of 24:24 18:30:03,122