in reply to Inserting a character to a line
The second approach can also be implemented with sed:substr($x, 4, 0, "."); # method 1 $x =~ s/\A(....)/$1./; # method 2
Anchoring the regular expression using ^ may not be necessary depending on your situation.sed -e 's/^(....)/\1./'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Inserting a character to a line
by pinpe (Novice) on Mar 22, 2008 at 01:41 UTC |