[Nottingham] Howto delete chars from midway into lines of text?
Martin
martin at ml1.co.uk
Thu May 6 13:00:34 UTC 2010
On 06/05/10 13:46, Martin wrote:
> On 06/05/10 13:37, TJ wrote:
>> sed 's/\("\)\([^",]*\)\("\)/\2/4' test.csv
>>
>> Replace the final '4' with N.
>
> Excellent!
>
> That works a treat and is far better than counting characters...
Slight improvement for my case:
sed 's/\("\)\([ .0-9]*\)\("\)/\2/g'
That now will convert all quoted text numbers to non-quoted.
Yeah! The power of open source!!
:-)
(Never thought to use positional parameters. Rather neat!)
Cheers,
Martin
--
----------------
Martin Lomas
martin at ml1.co.uk
----------------
More information about the Nottingham
mailing list