M
Matilda
Hi All,
I have a very tricky import problem.
My directory contains files named according to the following convention:
7 digits, 1 alpha
where the first 4 digits represent an ID
5th digit is a filler,
last two digits represent a month of the year
alpha character identifies a file belonging to the group for that month.
The list then looks something like this:
1234901a.txt
1234901b.txt
1234901c.txt
1234902a.txt
1234902b.txt
1234903a.txt
1234903b.txt
1234903c.txt
1234903d.txt
2234901a.txt
2234901b.txt
2234902a.txt
2234902b.txt
2234902c.txt
2234902d.txt
2234902e.txt
2234903a.txt
2234903b.txt
What i need to do is
1) import each file belonging to an ID for each month.
2) after each ***month*** is complete, I need to perform some code
3) after every file is processed for each ID, I need to perform some more
code.
4) repeat from step 1 to end of directory.
I have tried importing the file list into a table, (called FileList) and
breaking down the filename into components ID, Month and assigning an index
to give the number of files for the month, but I simply cannot construct the
code that will read down the list of records in the table, putting the
elements into variables that I can using to pass an sql string.
Am I even on the right track?
I have a very tricky import problem.
My directory contains files named according to the following convention:
7 digits, 1 alpha
where the first 4 digits represent an ID
5th digit is a filler,
last two digits represent a month of the year
alpha character identifies a file belonging to the group for that month.
The list then looks something like this:
1234901a.txt
1234901b.txt
1234901c.txt
1234902a.txt
1234902b.txt
1234903a.txt
1234903b.txt
1234903c.txt
1234903d.txt
2234901a.txt
2234901b.txt
2234902a.txt
2234902b.txt
2234902c.txt
2234902d.txt
2234902e.txt
2234903a.txt
2234903b.txt
What i need to do is
1) import each file belonging to an ID for each month.
2) after each ***month*** is complete, I need to perform some code
3) after every file is processed for each ID, I need to perform some more
code.
4) repeat from step 1 to end of directory.
I have tried importing the file list into a table, (called FileList) and
breaking down the filename into components ID, Month and assigning an index
to give the number of files for the month, but I simply cannot construct the
code that will read down the list of records in the table, putting the
elements into variables that I can using to pass an sql string.
Am I even on the right track?