Ankur_kuls has asked for the wisdom of the Perl Monks concerning the following question:
I have two perl files which after processing produce a output file. these files contain records, end part of which look like below.
\"version\":\"2.0\"}")]]]Now for few days we are receiving new line character in the records like below which is causing failure.
\"version\":\"2.0\"}\n")]]]Now for this I used the below extra statemnet (4th one in below code) which is working perfectly
while(<AH>) { chomp; my $line=$_; $line =~ s/\\n\"\)]]]$/")]]]/g;
Now problem is, that these files contain millions of records & because of this extra command it is taking exactly double time (earlier 1.5 hrs now 3 hrs). Is there any other way to remove it in efficient way...Please help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to remove a specific character from a file efficiently..
by ikegami (Patriarch) on Jul 02, 2014 at 05:03 UTC | |
|
Re: how to remove a specific character from a file efficiently..
by jellisii2 (Hermit) on Jul 02, 2014 at 11:34 UTC | |
|
Re: how to remove a specific character from a file efficiently..
by gurpreetsingh13 (Scribe) on Jul 02, 2014 at 10:04 UTC | |
by ikegami (Patriarch) on Jul 02, 2014 at 22:33 UTC | |
by gurpreetsingh13 (Scribe) on Jul 03, 2014 at 03:50 UTC | |
|
Re: how to remove a specific character from a file efficiently..
by RonW (Parson) on Jul 02, 2014 at 20:30 UTC |