Importing CSV w/report title stripped out..

LeverColson

New member
Local time
Today, 13:22
Joined
Nov 14, 2006
Messages
4
I need to import a .csv file into a table. The problem is the top title information is on the file, like below. I do not want to import report name, report date, include rows, number of rows, and the blank space. I need to start the import on the header row. This looks fine in excel of course, but when i need to import it into access, there is no need for it. How do i either strip that out during the import or skip it.

sample csv file:


----------------------------------------------------
Report name: xxxxxx
Report date: xxx
Include rows where.....
Number of row: xxxx

date,firstname,lastname,dollar,address,text
10/4,john,smith,888,12 w st,,
10/4,jane,smith,7575,34 w st,,

----------------------------------------------------

Any help would be great! Thanks!
 
If the sample data is EXACTLY the way the .csv file is, then use VBA Line Input to read-in the file until LEFT(strLineIn,5) = "date,", then start getting the data you need. To separate the field values, use the "," as the delimiter to break the line into field values.
 
You can set up an import specification (for instructions do a search here on "import specification") to import a csv file by using Docmd.TransferText. Within the specification you can tell it which row the data starts at and even if it has a header.
 

Users who are viewing this thread

Back
Top Bottom