Welcome to WebmasterWorld Guest from 54.221.81.125

Forum Moderators: bakedjake

Message Too Old, No Replies

all lowercase text

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 8, 2003
posts:659
votes: 0


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 12, 2002
posts:885
votes: 0


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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 8, 2003
posts:659
votes: 0


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

Junior Member

10+ Year Member

joined:Dec 1, 2003
posts:120
votes: 0


perl -ne 'print lc' yourfile.txt

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

and probably a dozen other ways..