PDA

View Full Version : Multiconvert lowercase filenames to uppercase Help


SUF6NEWBIE
04-16-2004, 02:10 AM
Howdy all.

Could somebody help with a code suggestion to help with:

file.find *.*** all file types in a directory(including subfolder contents)
then convert all files from lowercase to uppercase
..Sorry I dont have my attempt code to give here, my machine is Down for
several days..
I think file.find to a table then perform split.path(target.filename..file.extension) and loop through is the key, however
I could not get the rename or copy to the source path working.

tks MTN

TJ_Tigger
04-16-2004, 03:07 PM
You could try something like this

strfolder = Dialog.FolderBrowse("Please Select a folder.", _DesktopFolder);
tblFiles = File.Find(strfolder, *.*, true, true, nil);
TBLFILES = {};
for fileindex,file in tblFiles do
file = String.Upper(file);
Table.Insert(TBLFILES, fileindex, file);
end

SUF6NEWBIE
04-16-2004, 07:31 PM
TKS TJ the tables code, helped with
other stuff too in my App. also.
tables , tables, tables.....

your da man...

SUF6NEWBIE
04-16-2004, 10:10 PM
this got things to works fine.. dropped the additional table idea..

code:

strfolder = "F:\\BINS\\STD\\" -- or using a folder.browse 'result'
tUpper = File.Find(strfolder .. "\\" , "*.*", true, true, nil);
for fileindex,file in tUpper do
new_file = String.Upper(file);
tempname = file .. "_" -- needs to be done to
File.Rename(file, tempname); -- make this work
File.Rename(tempname, new_file);
end

TJ_Tigger
04-17-2004, 09:33 AM
good deal :)