Mailinglist Archive: opensuse (2731 mails)

< Previous Next >
Re: [SLE] ?program to replace text in text files
  • From: zentara <zentara@xxxxxxxxxxx>
  • Date: Thu, 21 Aug 2003 12:56:59 -0400
  • Message-id: <20030821125659.25f2f263.zentara@xxxxxxxxxxx>
On Thu, 21 Aug 2003 08:40:23 -0700 (PDT)
James Philp <linuxjames2003@xxxxxxxxx> wrote:

>Thanks a lot. Brilliant little trick. However it only
>does it for the first row of the data. So I just had

>> perl -pi -e 's/NaN/\./' file.csv
>> Take a backup first!

Put a 'g' modifier on the regex
perl -pi -e 's/NaN/\./g' file.csv

or try the "line" modifier
perl -lpi -e '$_ =~ s/searchstring/replace string/' file.txt

I'm not really a human, but I play one on earth.

< Previous Next >