Hey.. I'm looking for some regex help.
I have a large csv file like:
name,v1,v2,v3
s1,1.0,2.0,3.0
s2,1.1,2.1,3.1
s3,Error: blah3,2.0,3.1
s4,1.0,2.0,Error: blah4
s5,1.0,Error: blah5,3.0
I'm looking to remove all the "Error"(s).
So I start with:
rob@Galadriel:~/test$ sed -e 's/Error.*,//g' test.csv
name,v1,v2,v3
s1,1.0,2.0,3.0
s2,1.1,2.1,3.1
s3,3.1
s4,1.0,2.0,Error: blah2
s5,1.0,3.0
And this sort of works (ok, not really). I think I need to tell it "up TO the next comma" because it's removing the comma.
Then there is the case on line s4 where it's the EOL. So I need some sort of OR statement there. (comma OR EOL).
Can some regex guru throw me a bone here please?
Rob.