Create Directory Structure

G

Guest

I will be receiving around 40,000 text files that I will be modifying
programmatically (I'm removing header information in each file).

The issue is that these files will be in different
directories/subdirectories. What I'll probably end up doing is copying the
entire structure and files and perform the modifications on the copied set.

I'd like to loop through these text files, edit them accordingly, and then
rename them (I'll keep the same file name, but add something like "-edited"
to the end).

My question is, can this all be done together in one module? (not sure if
you can edit a text file and then rename that file as something else). I
know you can edit a file and then rename it TO another file, while keeping
the original file intact.

So, I'll edit the file, then do something like the following to create the
file:
Set txtout = fso.CreateTextFile()
txtout.WriteLine...

Then rename it:
Name Oldfile as Newfile...

Just curious if this is the right path...

Thanks for any and all reponses.
 
G

Guest

Hi Craig:

I'm not sure what you are trying to do... As I read it you have a table that
you wish to copy over to a new table, then loop through all the records,
editing a certain field as "edited" if changed?

Cheers,
Al
 
J

John Spencer

I would create the new file and edit the new file. I believe that if you
try editing the existing file, you will do exactly that and your changes
will be saved in the existing file.

FileCopy "OldFilePath","NewFilePath"


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top