Removing whole lines if one CSV Field meets a condition
Posted: Thu May 11, 2006 2:26 am
I'm using textpipe to change some CSV files. If a specific field is empty, I need to delete the entire line. I tried using restrict filters to look at the specific fields only and when I do remove all it only deletes the lines inside of that field.
Here is some sample input:
ABC123,123456,12/6/2005,blahblah,3, ,,ABC
I want the whole line deleted if either CSVfields 5 or 6 are blank.
Here is the easypattern i tried with a remove non-matching lines filter:
[longest oneOrMore letters, longest oneOrMore digits][comma][longest oneOrMore digits][comma][(digit,digit,slash,digit,digit,slash,digit,digit,digit,digit) or (digit,digit,slash,digit,slash,digit,digit,digit,digit)][comma][CSVField][comma][(longest oneOrMore digits) or (longest oneOrMore digits period longest oneOrMore digits)][comma][longest oneOrMore digits][comma][comma]['ABC']
The funny thing is that I had this working yesterday and I come in today and now it doesn't. Any help would be greatly appreciated.
Here is some sample input:
ABC123,123456,12/6/2005,blahblah,3, ,,ABC
I want the whole line deleted if either CSVfields 5 or 6 are blank.
Here is the easypattern i tried with a remove non-matching lines filter:
[longest oneOrMore letters, longest oneOrMore digits][comma][longest oneOrMore digits][comma][(digit,digit,slash,digit,digit,slash,digit,digit,digit,digit) or (digit,digit,slash,digit,slash,digit,digit,digit,digit)][comma][CSVField][comma][(longest oneOrMore digits) or (longest oneOrMore digits period longest oneOrMore digits)][comma][longest oneOrMore digits][comma][comma]['ABC']
The funny thing is that I had this working yesterday and I come in today and now it doesn't. Any help would be greatly appreciated.