For Programmers: Free Programming Magazines  


Home > Archive > Tcl > April 2005 > Changing case of file names









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Changing case of file names
Preserved Killick

2005-04-27, 4:00 pm


Just wondering if anyone had some quick tools for converting filenames
to lower case. Another useful tool would be one that changes all
letters but the first to lc.

thanx,

pk

Jeff Godfrey

2005-04-27, 4:00 pm


"Preserved Killick" <johnvhite@texoma.net> wrote in message
news:1114608120.187029.122930@l41g2000cwc.googlegroups.com...
>
> Just wondering if anyone had some quick tools for converting filenames
> to lower case. Another useful tool would be one that changes all
> letters but the first to lc.


Like this?

% set fName "MYFILENAME.TXT"
MYFILENAME.TXT
(bin) 2 %
(bin) 2 % string tolower $fName
myfilename.txt
(bin) 3 % string totitle $fName
Myfilename.txt
(bin) 4 %

Jeff


Preserved Killick

2005-04-27, 4:00 pm

Yep, was unaware of totitle. No excuse for tolower though. (Mr Duh now
remembers having read about it, but has regexp on the brain.) I'll
throw in a glob and file rename and get it fixed.

Thanks

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com