Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    buggsbunny4 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2012
    Posts
    8
    Hi Steve,

    Yup, DB with different tables would be fine. Please find the attached sample database for ur reference.

    Thanks
    rk

    Quote Originally Posted by ssanfu View Post
    OK.......



    How about a dB with the different tables for each individual section and some sample data in them?

    Do you have a text file with actual data? I don't think you really have a field named "PrimaryKey" with data "Key1", "Key2",...
    Attached Files Attached Files

  2. #17
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    OK, this is where the code is at now

    And now...

  3. #18
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    ParsingExample.zip

    Here's an example, put both files in the same directory then run the module Mod_ImportData

  4. #19
    buggsbunny4 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2012
    Posts
    8
    Hi, Thanks for the code. It works pretty good. My question is how we can update the code if we have multiple text files which need to be imported to the tables and also for section 3 there are occasions when some of the records in column 2 might have multiple rows. In this case I would like to have the data in the same record even though it spans multiple lines. Please see the attached file for sample database and text files. Also I think you used tab delimited to split the data but the problem is the files are not always tab delimited. The way i would like to have is the columns will have fixed length and I would like to split based upon the length.

    Thanks
    rk


    Quote Originally Posted by rpeare View Post
    ParsingExample.zip

    Here's an example, put both files in the same directory then run the module Mod_ImportData
    Attached Files Attached Files

  5. #20
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I can't read access 2007 files most of the time but I can answer your questions.
    I used a tab delimiter because the file you originally posted was tab delimited, if you want to use a mid() function to peel out your data that's up to you.

    If you are processing multiple files just use the filesystemobject commands to cycle through files in a directory, here's a link to show you how:

    http://www.4guysfromrolla.com/webtec...ect/faq5.shtml

    As far as parsing (I assume you're talking about section 3 of the report) multiple lines into a single record, much like I'm testing for the "SECTION" string you can test for the "TEST" string within the loop mechanism of the section 3 case statement, in essence a select case within a select case.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Import multiple text files automatically
    By instructorTek in forum Import/Export Data
    Replies: 30
    Last Post: 10-20-2012, 04:50 PM
  2. Import multiple Text files with a Macro
    By ArchMap in forum Access
    Replies: 3
    Last Post: 07-01-2011, 04:56 PM
  3. Import Text Files without access
    By 95DSM in forum Import/Export Data
    Replies: 1
    Last Post: 09-10-2010, 04:36 PM
  4. Replies: 4
    Last Post: 07-15-2010, 05:58 PM
  5. Import multiple dbf files into existing table?
    By sbg2 in forum Import/Export Data
    Replies: 0
    Last Post: 06-12-2006, 02:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums