![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replacing Text in Text file | cgilchrist | Shell Programming and Scripting | 3 | 06-30-2008 11:32 PM |
| replacing strings with text from other file | mc1392 | Shell Programming and Scripting | 1 | 03-24-2008 03:46 PM |
| replacing a nul field with text | DarkHound | Shell Programming and Scripting | 3 | 09-04-2007 03:34 PM |
| Replacing text | chrchcol | Shell Programming and Scripting | 3 | 07-25-2006 01:30 PM |
| replacing text | ajaya | Shell Programming and Scripting | 2 | 04-12-2006 01:31 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
replacing text in a file, but...
Hi all,
Very first post on this forums, hope you can help me with this scripting task. I have a big text file with over 3000 lines, some of those lines contain some text that I need to replace, lets say for simplicity the text to be replaced in those lines is "aaa" and I need it to replace it for something else... but before you think of sed's substitution 's///' or python's s.replace() method or similar ways, the resulting text should NOT be the same for every occurrence of "aaa", that is, I need the replacements to be unique (this does not happens with the above functions as all of the occurrences are replaced with the same text. For example, for the first occurrence of "aaa" replace it with "aaa1", the second "aaa2" and so forth. I doesn't necessarily have to be sequential it just has to be unique. Any input is appreciated, Thank you. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|