tsk1979 has asked for the wisdom of the Perl Monks concerning the following question:
The second file contains data. I am wondering whats the best way to write a perl script which replaces "foo" with "bar" on the line numbers mentioned in the index file? The method I currently thought up will be CPU intensive, i.e. parsing the data file multiple times. For example if index as 100 entries, I will parse the data file 100 times. Big data file means inefficient processing. I think using sort, and some kind of partial processing will help here better?1145 3453 4534 345 3 456 . . .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing expression on certain line numbers
by karavelov (Monk) on Jul 14, 2008 at 08:29 UTC | |
by shmem (Chancellor) on Aug 03, 2008 at 22:00 UTC | |
by FunkyMonk (Bishop) on Jul 14, 2008 at 15:32 UTC | |
|
Re: Replacing expression on certain line numbers
by moritz (Cardinal) on Jul 14, 2008 at 07:28 UTC | |
|
Re: Replacing expression on certain line numbers
by Corion (Patriarch) on Jul 14, 2008 at 07:16 UTC |