Importing from text file.

  • Thread starter Thread starter Antonio
  • Start date Start date
A

Antonio

Our IT department delivers a floppy disk with a report
that we would like to import into our Access database. I
set up the import process as such:

1. Rename file to xxx.txt
2. Open file and remove all header/footer, mid
header/footer info. (each report contains the printer
settings and various non-report related data at the
beginning, middle, and end of the report)This leaves just
the essential information.
3. Select all and copy the data.
4. Paste data into ERLog.txt which is linked to the table
section of the database. Save.
5. Open the database and run the append/update query
which will move the data into the final table (tblERLog)
add the transaction date to each record. (the
header/footer sections of the report contain the
transaction date only once in the original text file.)

Is there a way to programatically remove all of the
header/footer info and import it into a table in our
database in one shot. A button that would remove the
unnessesary data and then append/update it to the table
in the database?
This would forego the need to have the link from the
tables section in the database to the Folder these text
files are saved in. I want to cut the steps it takes to
get the data into the database and make it as easy as
possible.

TIA
 
Antonio,

I have a similar situation whereby I import from a text file which is
actually a printer file of a report from another system, and, much like
yours, is page-formatted with header and footer on every page. I took a
somewhat different approach, which you might want to consider: instead of
"cleaning-up" the file before importing, I linked the file as is and did the
parsing so that my real data gets correcctly in the fields, whereas in the
redundant lines I get rubbish in most or all fields. Then I use the linked
text file as the input table to a query whereby I filter out the rubbish,
for instance by criteria such as Not Like '----" & *, or mathematical
criteria on numeric fields etc. This way the query returns actual data
records only, and I append from there.

HTH,
Nikos
 
-----Original Message-----
Antonio,

I have a similar situation whereby I import from a text file which is
actually a printer file of a report from another system, and, much like
yours, is page-formatted with header and footer on every page. I took a
somewhat different approach, which you might want to consider: instead of
"cleaning-up" the file before importing, I linked the file as is and did the
parsing so that my real data gets correcctly in the fields, whereas in the
redundant lines I get rubbish in most or all fields. Then I use the linked
text file as the input table to a query whereby I filter out the rubbish,
for instance by criteria such as Not Like '----" & *, or mathematical
criteria on numeric fields etc. This way the query returns actual data
records only, and I append from there.

HTH,
Nikos




.
Thanks for the help....I am going to give it a shot.
 
Back
Top