Re: Best way to import text file into existing table on a daily ba

Tech-Archive recommends: Fix windows errors by optimizing your registry



Comments inline..

--

Ken Snell
<MS ACCESS MVP>


"bluesky" <bluesky@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5C151D4B-C247-4AF0-9766-2C5B9CEBFB07@xxxxxxxxxxxxxxxx
Hi Ken,

Thanks for your quick reply. Actually the temp file has two header rows.
One is a title of the report and the second row are field names. I think
the
"two" headed rows are an issues.

ACCESS' built-in text file import process can handle one header row, but not
two. The header row must contain field names for each "column" in the text
file's records, and should match the field names in the table that is
receiving the imported data. If you have two header rows, you'll either need
to manually edit the text file to delete the first row, or you'll need to
write a VBA program that will open the text file and walk through the file's
records and do the import process one record at a time.



Also, the text files has some extra rows, like report date, etc. So I
guess
I have to delete those as well!!


Not sure what you mean by extra rows, but if these extra rows contain
"extraneous" information that does not conform to the "fields" / "columns"
that otherwise are in the file's records, then, yes, you'll either need to
delete them manually or use VBA programming to do the import (see above).


.



Relevant Pages

  • Re: VBA Formatting
    ... Here is the workbook I use to test it: ... Dim myRow As Long, i As Long ... is the header rows without details should only have 1 space below it and the next header row should start. ... How can I using VBA delete the extra rows when sometimes it may be 2 extra rows, sometimes 3 extra rows or no extra rows. ...
    (microsoft.public.excel)
  • VBA Formatting
    ... I have a spreadsheet that has header rows and detail rows. ... delete the extra rows when sometimes it may be 2 extra rows, ...
    (microsoft.public.excel)
  • Re: VBA Formatting
    ... Dim myRow As Long, i As Long ... the header rows without details should only have 1 space below it and the ... This is also true with the detail rows. ... VBA delete the extra rows when sometimes it may be 2 extra rows, ...
    (microsoft.public.excel)
  • Re: VBA Formatting
    ... Dim myRow As Long, i As Long ... End Sub ... the header rows without details should only have 1 space below it and the next header row should start. ... How can I using VBA delete the extra rows when sometimes it may be 2 extra rows, sometimes 3 extra rows or no extra rows. ...
    (microsoft.public.excel)