Avatar of Aaron Greene
Aaron Greene
Flag for United States of America asked on

Reading data from a csv file into access table

I would like to build a database application that I can use to manipulate data read from a csv file.  The csv file is a data dump from a Wonderware HMI application.  It contains all of the tags used in the application grouped by a keyword.  As the csv file is read, the application will need to determine if the row of data is a header row or a data row.  If it is a header row, the first column name will begin with a keyword.  I would like to use this keyword to determine the table that the subsequent rows should be imported into.  I have attached a spreadsheet that shows the raw csv file and an edited to show the logic that I have been using.  I have to do this process for every project that I work on, so it would save me a huge amount of time if I could automate this.
ee.xlsx
Microsoft Access

Avatar of undefined
Last Comment
Gustav Brock

8/22/2022 - Mon
als315

It is not a csv file, you should read it line by line from vba. Can you upload original source file and structure of access table?
ASKER CERTIFIED SOLUTION
Gustav Brock

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Aaron Greene

ASKER
I'm not sure that I follow your line of thought.  What is the intFileDesc variable used for?
Gustav Brock

That's the file handler. You can have more than one file open, then you'll have to differentiate between them.

/gustav
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Aaron Greene

ASKER
Okay, I see what you are doing there.  Now, I will need to take the data read from the csv and manipulate it so I can add it to the target tables.  I would like to use the split function to break the strTextLine instead of using a bunch of text functions.
Gustav Brock

That's a viable option. The code origins from the time before Split.

/gustav