Results 1 to 12 of 12
  1. #1
    anishkgt is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    10

    Import text file to table

    Hi,

    Was wondering how i can or maybe get a tutorial on how to read data in file(attached) and import data by reading certain amount of characters in a line like A02 and read 30 to 40 characters which has the Name of a passenger and may 20th to 25 has the name of an Airline. Import these data into a table with pre-assigned columns.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    anishkgt is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    10
    Quote Originally Posted by June7 View Post
    Without any programming background at all, would you please suggest a tutorial which would have these.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Don't know any tutorials for importing text file. Only various code examples found on web.

    The text file you provide is not a columnar structure and this makes import difficult. If it were a columnar structure, the Access import wizard could easily do the import. What you have requires opening the text file as an object in VBA, reading in one line at a time and parsing the string to look for the data you want.

    If you have zero programming knowledge, start learning with:
    https://support.office.com/en-US/Art...rs=en-US&ad=US
    http://holowczak.com/programming-con...l-programmers/
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Do you know the structure of the text file? That is do you know where fields start and end?

  6. #6
    anishkgt is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    10
    Thanks june for the reply. Will check out that link. Yes orange i have a documentation on the structure of the data.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  8. #8
    anishkgt is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    10
    Hi orange,

    That video is specific to comma delimitated text file. I know what i need cannot be done with the wizards. It has to be through VB and more over my file as they come are by the extension .MIR

  9. #9
    anishkgt is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    10
    June those are just the basics to VB which is not enough for what i need here. Would you be having any other option.

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Have to start somewhere, crawl before walk.

    You need to learn programming concepts, VBA language and syntax, and then structure code specific to your circumstances. If self-teaching is not feasible then I expect courses from local university are available.

    If I understood your requirements, could maybe give you code snippet but I don't know what you want to extract from the text file. The description you provided is not clear and I don't know where the data is in the text file.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    anishkgt is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Posts
    10
    Yes june. You're right. Need to do all those. Well, those data is based on a structure that i could share by mail. Its a pdf file.

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Share by mail? Why don't you attach to post?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 10-08-2014, 11:05 AM
  2. import text file with text date
    By rody in forum Import/Export Data
    Replies: 5
    Last Post: 09-01-2014, 12:50 AM
  3. Replies: 2
    Last Post: 02-11-2014, 09:38 AM
  4. Replies: 7
    Last Post: 11-20-2012, 05:08 PM
  5. Replies: 5
    Last Post: 12-01-2011, 05:38 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