<p>The fifth "column" of the CSV is a negative number that needs the sign stripping? Or are you making positive numbers negative too?</p>
<div class="gmail_quote">On Oct 12, 2011 11:15 PM, "Andy White" <<a href="mailto:andy@milky.org.uk">andy@milky.org.uk</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
> Can anyone help me out on this one, which has got me tearing out the<br>
> small remaining amount of hair even after googling. I want to match<br>
> the minus sign character '-' in sed, but only if it occurs<br>
> immediately after the 5th comma in a line that starts with '0'. So<br>
> far I can match a minus sign following a comma in a line starting<br>
> with '0', but matching it only after the 5th comma is beyond me.<br>
<br>
Something like<br>
<br>
sed -r '/^0(.*,.*)(,.*)(,.*)(,.*)(,\-).*/p'<br>
<br>
> (More generally, I'm trying to simply invert the polarity of one of<br>
> the fields of a .csv file. Is there an easier approach than sed?)<br>
<br>
do what?<br>
<br>
I tend to use perl for pretty much everything, but I'm not certain<br>
what you're trying to do.<br>
<br>
andy<br>
<br>
_______________________________________________<br>
Nottingham mailing list<br>
<a href="mailto:Nottingham@mailman.lug.org.uk">Nottingham@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/nottingham" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/nottingham</a><br>
</blockquote></div>