in reply to Find pieces of text in a file enclosed by `@` and replace the inside
G'day kluther,
Rather than using all those substitutions, you can do a single transliteration. Here's a commandline example:
$ perl -Mstrict -Mwarnings -Mutf8 -e '
binmode STDOUT => ":utf8";
while (<>) {
s/@([^@]+)@/$_ = $1; y{abcABC}{абцАБЦ}; $_/eg;
print;
}
'
@abc@ abc @ABC@
абц abc АБЦ
cba @cba CBA@
cba цба ЦБА
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find pieces of text in a file enclosed by `@` and replace the inside
by kluther (Novice) on Mar 08, 2013 at 14:43 UTC | |
by kcott (Archbishop) on Mar 08, 2013 at 19:50 UTC | |
by Anonymous Monk on Mar 11, 2013 at 10:01 UTC | |
by kcott (Archbishop) on Mar 11, 2013 at 15:57 UTC | |
by kluther (Novice) on Mar 29, 2013 at 05:20 UTC |