Welcome to WebmasterWorld Guest from 54.167.185.18

Forum Moderators: bakedjake

Message Too Old, No Replies

all lowercase text

   
9:06 pm on Dec 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i'm new to linux. does anyone have a simple script to open up a text file and convert all the characters to lowercase?
9:37 pm on Dec 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nope, but it'd be really easy to write in Perl.


#/usr/bin/perl -w
while (<STDIN>) {
print lc($_);
}

$ cat textfile name-of-perl-file > lowercasefile

The above code is completely off-the-cuff, and Perl is not my primary language. It might destroy everything on your computer, or do nothing.

9:41 pm on Dec 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It probably won't do any damage. I'll try it. Thanks.
12:04 am on Dec 22, 2003 (gmt 0)

10+ Year Member



perl -ne 'print lc' yourfile.txt

tr '[A-Z]' '[a-z]' < yourfile.txt

and probably a dozen other ways..