String substitutions in ASCII files -
We need to scramble data in a number of ASCII files. Some of these files are extremely large (1.2 GB). By scrambling, I mean that we need to substitute certain strings, which number around 400, with scrambled strings. An example has been given below
If "London" occurs in the file, then it needs to be substituted by "X1"
If "Frankfurt" occurs in the file, then it needs to be substituted by "X2".
We have written a Korn shell script, but there are huge performance problems as we need to check for 400 different strings. What is the best way of doing this ?.
The machine is HP-UX B.11.00 E 9000/800.
The solution suggested by Perderabo works...................
...............like LIGHTNING.
Thanks a lot for the help.
Last edited by SanjivNagraj; 07-04-2002 at 03:52 AM.
|