How can you delete records in a file matching a pattern?
I am curious if the following can be done in a file in unix. Let's say I have a flat file with the following data
AAA,12,2,,,,
BBB,3,1,,,,
CCC,,,,,
DDD,2,,,,,
SQQ,,,,,
ASJ,,3,5
I only want to capture the data with values into a new file. If the data contains the pattern ,,,,, as in records CCC and SQQ above, I want it filtered out, however I want to keep all of the other records.
The resulting file should look like:
AAA,12,2,,,,
BBB,3,1,,,,
DDD,2,,,,,
ASJ,,3,5
Any ideas on how to accomplish this?