![]() |
|
|
|
|
|||||||
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replace characters in a string using their ascii value | roops | Shell Programming and Scripting | 2 | 03-03-2005 09:51 PM |
| text files, ASCII files, binary files and ftp transfers | Perderabo | Answers to Frequently Asked Questions | 0 | 04-08-2004 01:25 PM |
| open ASCII files | Wing m. Cheng | High Level Programming | 2 | 10-27-2001 12:12 PM |
| ASCII Files | yialousa | UNIX for Dummies Questions & Answers | 1 | 08-09-2001 04:27 AM |
| How can I ... (Modifying large ASCII files) | hviktor | UNIX for Dummies Questions & Answers | 2 | 07-20-2001 07:28 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
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 | ||
|
|
|
|||
|
Using Sun OS 5.6..and for me the limit for sedfile usage is 199. Not 200 but 199 substitutions. I had a similar exercise once replacing a ceratin field with it's encrypted value - but I had around 10,000 substitutions to complete.
I'm not sure of the limitations on the -e flag...i.e. I have no idea howmany -e's you can have..but this may be high...(although I doubt it would be). If you knew perl you could compile the similar with one pass of the file...although somewhat more effort to set up.
__________________
Pete |
|||
| Google UNIX.COM |