<p>The fifth &quot;column&quot; 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, &quot;Andy White&quot; &lt;<a href="mailto:andy@milky.org.uk">andy@milky.org.uk</a>&gt; 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>
&gt; Can anyone help me out on this one, which has got me tearing out the<br>
&gt; small remaining amount of hair even after googling.  I want to match<br>
&gt; the minus sign character &#39;-&#39; in sed, but only if it occurs<br>
&gt; immediately after the 5th comma in a line that starts with &#39;0&#39;.  So<br>
&gt; far I can match a minus sign following a comma in a line starting<br>
&gt; with &#39;0&#39;, but matching it only after the 5th comma is beyond me.<br>
<br>
Something like<br>
<br>
sed -r &#39;/^0(.*,.*)(,.*)(,.*)(,.*)(,\-).*/p&#39;<br>
<br>
&gt; (More generally, I&#39;m trying to simply invert the polarity of one of<br>
&gt; 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&#39;m not certain<br>
what you&#39;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>