Saturday 1 August 2015

Find the bad record in a file using Sed and AWK command

I have a file which has 23 million records loading into a stage table using Informatica.
Suddenly there is a failure due to bad record in between loading.Our file delimiter is " | " pipe. 
There is an extra pipe in between the fields. My file has 11 fields.



sed -n '14409589,2300000p' <filename>| awk -F "|" 'NF != 11'

returns the rows that have more than 11 columns.

No comments:

Post a Comment