Extract row grater than 3 from previous value of a field

Hi,

I am trying to extract data where first field unique value and 4th field of next row is grater than first row 4th field.

input data is a below:

 7035719974,20-jul-2016 07:42:51,07:42:51,074251,1
7035719974,20-jul-2016 07:43:57,07:43:57,074357,2
7399206761,20-jul-2016 04:16:30,04:16:30,041630,1
7399206761,20-jul-2016 04:16:30,04:16:30,041630,2
7662002928,20-jul-2016 08:50:15,08:50:15,085015,1
7662002928,20-jul-2016 08:52:31,08:52:31,085231,2
7662004970,20-jul-2016 08:30:16,08:30:16,083016,1
7662004970,20-jul-2016 08:33:55,08:33:55,083355,2
7662010253,20-jul-2016 07:21:35,07:21:35,072135,1
7662010253,20-jul-2016 07:23:19,07:23:19,072319,2
7662011525,20-jul-2016 10:16:36,10:16:36,101636,1
7662011525,20-jul-2016 10:16:37,10:16:37,101637,2
7662012030,20-jul-2016 01:00:00,01:00:00,010000,1
7662012030,20-jul-2016 09:41:39,09:41:39,094139,2
7662020365,20-jul-2016 09:51:55,09:51:55,095155,1
7662020365,20-jul-2016 10:51:46,10:51:46,105146,2
7662021790,20-jul-2016 03:50:00,03:50:00,035000,1
7662021790,20-jul-2016 03:52:28,03:52:28,035228,2
7662023663,20-jul-2016 06:00:40,06:00:40,060040,1
7662023663,20-jul-2016 06:00:40,06:00:40,060040,2

Desired output should be as below:

 7035719974,20-jul-2016 07:42:51,07:42:51,074251,1
7035719974,20-jul-2016 07:43:57,07:43:57,074357,2

I am unable to extract the same however I had inserted the fifth field by identifying the first column duplicate and the fifth column contains 1 and 2 values for every duplicated rows based on first column.

Any attempts/ideas/thoughts from your side?

And, why just those two lines in the output? There's other lines that fulfill your requirement as well...

Howsowever, try:

awk '{getline T; split (T, TMP); if ($4 < TMP[4]) {print; print T}}' FS=, file4
7035719974,20-jul-2016 07:42:51,07:42:51,074251
7035719974,20-jul-2016 07:43:57,07:43:57,074357
7662002928,20-jul-2016 08:50:15,08:50:15,085015
7662002928,20-jul-2016 08:52:31,08:52:31,085231
7662004970,20-jul-2016 08:30:16,08:30:16,083016
7662004970,20-jul-2016 08:33:55,08:33:55,083355
7662010253,20-jul-2016 07:21:35,07:21:35,072135
7662010253,20-jul-2016 07:23:19,07:23:19,072319
7662011525,20-jul-2016 10:16:36,10:16:36,101636
7662011525,20-jul-2016 10:16:37,10:16:37,101637
7662012030,20-jul-2016 01:00:00,01:00:00,010000
7662012030,20-jul-2016 09:41:39,09:41:39,094139
7662020365,20-jul-2016 09:51:55,09:51:55,095155
7662020365,20-jul-2016 10:51:46,10:51:46,105146
7662021790,20-jul-2016 03:50:00,03:50:00,035000
7662021790,20-jul-2016 03:52:28,03:52:28,035228