[Nottingham] Sed regex problem

Dave Luff daveluff at ntlworld.com
Wed Oct 12 21:21:20 UTC 2011


Hi List,

Can anyone help me out on this one, which has got me tearing out the 
small remaining amount of hair even after googling.  I want to match the 
minus sign character '-' in sed, but only if it occurs immediately after 
the 5th comma in a line that starts with '0'.  So far I can match a 
minus sign following a comma in a line starting with '0', but matching 
it only after the 5th comma is beyond me.  Any advice?

(More generally, I'm trying to simply invert the polarity of one of the 
fields of a .csv file.  Is there an easier approach than sed?)

Cheers - Dave



More information about the Nottingham mailing list