![]() |
|
|
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 |
| exract string between two different characters | rein | Shell Programming and Scripting | 11 | 05-07-2008 10:01 AM |
| Add string after another string with special characters | heliode | Shell Programming and Scripting | 2 | 03-21-2008 08:06 AM |
| Removing characters from a string | mh53j_fe | Shell Programming and Scripting | 3 | 06-03-2005 01:35 PM |
| Removing characters from end of $string | craig2k | Shell Programming and Scripting | 3 | 03-25-2003 10:38 AM |
| removing characters from end of string | el_toro | Shell Programming and Scripting | 4 | 07-14-2002 09:02 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to change only the x first characters of a string?
Hi,
How can I replace x first characters from a string? I have a file with... say 10000 entries as follows: 00123456781 00123456782 00123456783 ... What I want to do is change the leading "00" with for example "12" The leading 00 can be in some files some other 1 or more digits e.g. "1" or "123" or what ever. What would be the most efficient way of doing this as there might be even 20.000.000 entries in one file. I wonder if the method could be embedded to a oneliner such as: perl -i -p -e "s/old/new/g" filename Thanks! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|