Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cASe SeNSiTiviTY

Status
Not open for further replies.

DJVisuaL

Programmer
May 31, 2000
52
US
I have a huge directory of txt files and I wanted to take the Parenthesis out of the filenames.. but the prob is VFP renames them fine but it messes up the case of the filenames (which is important) so I'm back 2 sqaure 1.. I think removing the parenthesis by hand would be easier than redoing the case on them all so its a no win situation.. anybody know how to make VFP recognize the case?
I am using ADIR() to load the file names into an array and STRTRAN() to take the Parenthesis out.. then RENAME to rename them...
lil help?
thanks
DJ
[sig][/sig]
 
Hi DJ,

If you have the Windows Scripting Host:

oFSO = CreateObject("Scripting.FileSystemObject")
oFolder = oFSO.GetFolder(lcMyFilesFolder)
FOR EACH oFile IN oFolder.Files
lcMyNewFilePath=STRTRAN(oFile.Path,'(','')
oFile.Copy(lcMyNewFilePath)
oFile.Delete
ENDFOR

If you dont, look into the MoveFile() ,FindFirstFile(), &FindNextFile() API functions. [sig]<p>Jon Hawkins<br><a href=mailto: jonscott8@yahoo.com> jonscott8@yahoo.com</a><br><a href= > </a><br>Focus on the solution....Not the problem.[/sig]
 
DJVisuaL, Try to use &quot;MoveFile&quot; Windows API function. If you will have difficulties with API, let me know, I will write samples. [sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top