I have a file test.dat with delimited text. Delimiter is | containing 4 columns in a file. But due to some issue, there is some discrepancy in the number of columns for some of the rows. I have found those rows using awk command. Now I need to delete those rows.test.dat:a|b|c|da|b|ca|b|c|d|eI found rows with:awk -F | 'NF!=4' test.datResult:a|b|ca|b|c|d|eNow I need to delete this from the file.Any pointers. I used xargs but didn't work.
Delete the data based on the output of awk command
awk