The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-03-2002
SanjivNagraj SanjivNagraj is offline
Registered User
 

Join Date: Jul 2002
Posts: 1
Thumbs up 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.
Forum Sponsor