I need a script to check the records in a file , if any value match transfer the record in error.txt file.


1- If any of the any field value is NULL(nothing in this field)



Code:
Record1|Record2|Record3|Record4|Record5|DATE1|DATE 2


Example:



Code:
11111111|22222222|NULL|12|444|27042018|27042018 (Record3 is null)

99999999|88888888|007172FD|NULL|975|02052018|27042 018 (Record4 is null)

2- If any of the field value is set as 0, except Record4

Example:



Code:
Record1|Record2|Record3|Record4|Record5|DATE1|DATE 2
Record1 = 0 or ‘00000000’
Record2 = 0 or ‘0000000000’
Record3 = 0 or ‘0000000000’



Code:
11111111111|000080809643|00000000|64|374|02052018| 27042018
11111111111|000000000000|45678987|64|374|02052018| 27042018
0000000000|000082079914|0071170B|1|308|27042018|27 042018
3- If Next DATE1/DATE2 values are not in DDMMYYYY format

4- If Record5 value is negative



Code:
11111111111|000045672345|45678987|64|-222|02052018|27042018