Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2002
    Posts
    4

    Question Unanswered: Table text from many text files as well as info from file name...

    Help, I am looking at consolidating upwards of 400 text files into a database. I have the files in folders, they are all delimited files with the same format and the name of each file is adhoc_12AUG02.txt or adhoc_14AUG02.txt.

    I would like to add the data from each file into a single table as well as adding the field that tells me the date from the file name (not the date that the file was last modified).

    I am looking into writing a module that, given the path to the folder, would grab each text file, table the data, somehow take the date out of the file name and then write all of that data to another "master" table where all of the data will be stored permanently.

    In all, I am a relative beginner with VBA, but fairly proficient with SQL, so please help.

    Thanks,

    Trevor
    Last edited by themanthemyth; 12-09-02 at 20:49.

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: Table text from many text files as well as info from file name...

    Hi Trevor,

    I have attached a db for you perusal. You will need to copy the db and textfile to the c:\temp foledr. This si a quick mock up to show u how to get the relevant bits of information.


    Originally posted by themanthemyth
    Help, I am looking at consolidating upwards of 400 text files into a database. I have the files in folders, they are all delimited files with the same format and the name of each file is adhoc_12AUG02.txt or adhoc_14AUG02.txt.

    I would like to add the data from each file into a single table as well as adding the field that tells me the date from the file name (not the date that the file was last modified).

    I am looking into writing a module that, given the path to the folder, would grab each text file, table the data, somehow take the date out of the file name and then write all of that data to another "master" table where all of the data will be stored permanently.

    In all, I am a relative beginner with VBA, but fairly proficient with SQL, so please help.

    Thanks,

    Trevor
    Attached Files Attached Files

  3. #3
    Join Date
    Dec 2002
    Posts
    4
    Thanks mona, I will give it a shot.

  4. #4
    Join Date
    Dec 2002
    Posts
    4
    Mona, I think that this will be enough to get me started, I will post again if (when) I have more questions, thanks again.

    Trevor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •