How to write a Perl script to convert file to all upper case? -
how can write perl script convert text file upper case letters?
perl -ne "print uc" < input.txt
the -n
wraps command line script (which supplied -e
) in while
loop. uc
returns all-uppercase version of default variable $_
, , print
does, well, know yourself. ;-)
the -p
-n
, print
in addition. again, acting on default variable $_
.
to store in script file:
#!perl -n print uc;
call this:
perl uc.pl < in.txt > out.txt
Comments
Post a Comment