[wellylug] perl - capitalize all text in file

Grant McLean grant at mclean.net.nz
Wed Mar 30 21:33:49 NZST 2005


On Wed, 2005-03-30 at 19:50 +1200, Mark Signal wrote:
> I have a large text file containing a mixture of lowercase and uppercase 
> text (and numbers). I need to make  all lowercase text become uppercase.

Just in case you're still interested in a Perl solution:

  perl -ne 'print uc' filename

or

  perl -pe 'tr/a-z/A-Z/' filename

and if you want to do it 'in-place':

  perl -n -i.bak -e 'print uc' filename

Cheers
Grant






More information about the wellylug mailing list