in reply to Case Munging
After this runs you have all "translated" names in <FILENAME>. The old version of the file is kept as "<FILENAME>.old".perl -i.old -pe 's/(?<![a-z])(\w)/uc $1/eg' <FILENAME>
And in case the regex is unclear: The first part is a negative lookahead (see perldoc perlre).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Case Munging
by morgon (Priest) on Apr 17, 2009 at 00:15 UTC | |
by AnomalousMonk (Archbishop) on Apr 17, 2009 at 02:16 UTC | |
by mikeraz (Friar) on Apr 17, 2009 at 02:38 UTC | |
|
Re^2: Case Munging
by mikeraz (Friar) on Apr 17, 2009 at 00:20 UTC |