brendonc has asked for the wisdom of the Perl Monks concerning the following question:
And the other file looks like this (DJB data file):10.1.3.1:frank 10.1.3.2:john 10.1.3.3:mis23455 ...
I want to take the first file, loaded with ip:machinename, and search the second file based on the IP address. Then, I want to replace the +host-* part with the proper machine name for that IP address. The finished data file (file 2) would look like this:... +host-1-3-1-10:10.1.3.1 +host-2-3-1-10:10.1.3.2 +host-3-3-1-10:10.1.3.3 ...
In other words, I want to use the data in the first file to search and replace data in the second. The data file is 130000+ lines long. What would be the best way process such a large file? I'm quite stuck at this point so any help would be useful.... +frank:10.1.3.1 +john:10.1.3.2 +mis23455:10.1.3.3 ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re: Search and replace on a 130000+ line file.
by Ovid (Cardinal) on May 11, 2001 at 22:21 UTC | |
|
Re: Search and replace on a 130000+ line file.
by ncw (Friar) on May 11, 2001 at 22:27 UTC | |
by sierrathedog04 (Hermit) on May 11, 2001 at 23:05 UTC | |
|
Re: Search and replace on a 130000+ line file.
by jepri (Parson) on May 11, 2001 at 22:11 UTC | |
by tadman (Prior) on May 11, 2001 at 22:25 UTC | |
|
Re: Search and replace on a 130000+ line file.
by Sifmole (Chaplain) on May 11, 2001 at 22:09 UTC | |
|
Re: Search and replace on a 130000+ line file.
by brendonc (Novice) on May 12, 2001 at 00:02 UTC |