Import txt file into access

Posted on 2012-09-06
Last Modified: 2012-09-06
I have a large txt file over 50K rows contains information formatted as in the code. How do I use vba to import it into a table in Access? Each block is separated by "---"

Name:            John Doe
ID Number:       123abc
Dob:      2/1990
Code:             111
Username:          user1
Code(2):        abc123
  Name:            John Doe
  Address:         123 Main St.
                   New York, New York, 12345 United States


Open in new window

Question by:AntiBook
    LVL 92

    Expert Comment

    by:Patrick Matthews
    Please upload a sample text file.  It does not have to be the complete file, but it does have to show all of the various nuances your source data can have.

    Please sanitize the data as needed to protect privacy/confidentiality.

    Author Comment

    please see the attached
    LVL 39

    Accepted Solution

    Test sample

    Author Closing Comment

    Thanks a lot

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now