Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Renaming files in a folder selectively
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01352035
Message ID:
01352044
Vues:
18
Boris

That looks great

Thanks

Colin

>>Hi
>>
>>I have a direrctory which contains a stack of BMP files - many of the file names are wrong - I can tell if a file is wrong by looking at the first character of the file name - based on what the first character is I know what the filename should be corrected to
>>
>>Has anyone any code that would help me do this?
>>
>>Thanks
>>
>>Colin
>
>
>RenameBadNames([c:\SomeFolder\*.BMP])
>
>
>FUNCTION RenameBadNames(lcFilePattern)
>    LOCAL lnFiles, laFiles[1], lnFor
>    LOCAL lcFilePath
>    lcFilePath = ADDBS(JUSTPATH(lcFilePattern))
>    lnFiles = ADIR(laFiles, lcFilePattern)
>    FOR lnForm = 1 TO m.lnFiles
>        IF LEFT(laFiles[lnFor,1]) == [BADCHAR]
>           lcOldName = lcFilePath+laFiles[lnFor,1]
>           lcNewName = lcFilePath+[PUT THE NEW NAME HERE]
>           RENAME (lcOldName) TO (lcNewName)
>        ENDIF
>    NEXT
>RETURN .t.
>
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform