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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to convert long file names automatically? 1

Status
Not open for further replies.

fpd26man

Programmer
May 20, 2005
8
US
I need to use a Foxpro-DOS program (running under XP) to process inventory counts stored in a text file with a long filename. The data in the filename is useful for processing so I'd like to be able to store that as well, then convert the long filename to a 8.3 format for use in the DOS Foxpro window.

The text file contains inventory counts from a wireless barcode scanner and the filename generated is something like:

01_2_20070512_101530.txt

where 01 is the store, 2 is the scanner ID, 20070512 is the date and 101530 is the time the file was created.

I'd like to store this info in a separate master file and then rename the above file to something meeting the DOS 8.3 convention, e,g. 01270512.txt. And I'd like to automate the process!

Can the low level file reading tools in DOS Foxpro process the LFN filename data? Or does anyone know of a utility which can be called to pass this data in a useable form?

Thanks for any help!

 
You can always make your own 'conversion' table which will contain the DOS 8.3 formatted file name in one field and the other long file name in another field.

Then when desired your application can access either and use it as needed.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Not sure how to do that as an automated process, though. The Foxpro-DOS program can't "see" the expanded filename. That's the problem. I see some shareware utilities on the 'net which can rename batches of LFN files but again it requires human intervention to use these programs. I want to do this programmatically with pre-determined renaming criteria to go from LFN to 8.3.
 
Looks like ezopaci has the function you need, see thread182-1379743.
 
Yes, I have it. :)
I will do some cleanup of code and then I send URL here.

Tomas
 
Thanks for all the help! I will try it out as soon as I can!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top