J
J. Verdaasdonk
Hi Everybody, 
Difficult question this time: (Hmmm for me so to speak)
I have a lot of *.txt files that are generated from a database.
In these files there is a Unique number normally these codes are 8
digits and sometimes 10! (Example: 12345678) All unique numbers are in
the top section of the files.
I would like to order all these files in to subfolders depending on the
first 4 numbers off the code! So 12345678 would go in to folder 1234
and 23456789 would go in to folder 2345.
All files are stored in: C:\My Documents\T-files
What I think I need is some code that will open this folder and reads
the contents of a *txt file. When it finds a Number it reads the first
four digits. These four digits represent the folder name in witch to
store this file.
With this number string a new folder is created and the *txt file of
witch it originated is transferred to this folder. Then the code will
go to the next *.txt files until there aren’t any left.
I don’t know if al of this is possible so I’ve tried to search for
alternative solution.
In stead of reading the content of the *.txt file maybe it’s possible
to open the txt file in to a new word document. Then find the Unique
number (8 to 10 digits) and then save this file in the folder that is
created from the first four numbers with perhaps the document name that
is the full 8 to 10 digits number?
I’m just brainstorming on a solution to get these *.txt files organized
in to a more friendly folder set up!
Anybody got Ideas?
Thnxxxx!
Difficult question this time: (Hmmm for me so to speak)
I have a lot of *.txt files that are generated from a database.
In these files there is a Unique number normally these codes are 8
digits and sometimes 10! (Example: 12345678) All unique numbers are in
the top section of the files.
I would like to order all these files in to subfolders depending on the
first 4 numbers off the code! So 12345678 would go in to folder 1234
and 23456789 would go in to folder 2345.
All files are stored in: C:\My Documents\T-files
What I think I need is some code that will open this folder and reads
the contents of a *txt file. When it finds a Number it reads the first
four digits. These four digits represent the folder name in witch to
store this file.
With this number string a new folder is created and the *txt file of
witch it originated is transferred to this folder. Then the code will
go to the next *.txt files until there aren’t any left.
I don’t know if al of this is possible so I’ve tried to search for
alternative solution.
In stead of reading the content of the *.txt file maybe it’s possible
to open the txt file in to a new word document. Then find the Unique
number (8 to 10 digits) and then save this file in the folder that is
created from the first four numbers with perhaps the document name that
is the full 8 to 10 digits number?
I’m just brainstorming on a solution to get these *.txt files organized
in to a more friendly folder set up!
Anybody got Ideas?
Thnxxxx!