G
Guest
I’m just exploring the possibilities of VBA in Access and I ran into a couple
of problems. I hope that one of you has a solution.
Problem:
I have to import text files with a ; as a delimiter, into access every
month. I’ve written a script that import these files and it work great. The
only problem is that the first 7 lines (header) and the last line (footer)
contain information about the file, sender etc of the file.
I want to store this data in a separate table in the database for logging
purposes. I’ve tried to do this with a make-table query after importing all
the text files I received (this query copies the 7 header rows and the footer
row into separate tables and combines them into 1 table.)
The problem is that every time I run the query it deletes the old table and
makes a new one. Not so great if you want to log the data for a longer
period. Another problem is that the header/footer data is stored in a single
column in the text file. I want to store every row in a single column.
For example:
The way I receive the data:
H1; fileID
H2; filedate
H3; sendernr
H4; receivernr
H5; product
H6; market
H7; version
F1; number of records
The way I want to store the data in a table:
fileID, filedate, sendernr, receivernr, product, market, version, number of
records
Does anybody have an idea on how to do this? I’ve tried but I can’t come up
with a solution.
Thanks a lot
of problems. I hope that one of you has a solution.
Problem:
I have to import text files with a ; as a delimiter, into access every
month. I’ve written a script that import these files and it work great. The
only problem is that the first 7 lines (header) and the last line (footer)
contain information about the file, sender etc of the file.
I want to store this data in a separate table in the database for logging
purposes. I’ve tried to do this with a make-table query after importing all
the text files I received (this query copies the 7 header rows and the footer
row into separate tables and combines them into 1 table.)
The problem is that every time I run the query it deletes the old table and
makes a new one. Not so great if you want to log the data for a longer
period. Another problem is that the header/footer data is stored in a single
column in the text file. I want to store every row in a single column.
For example:
The way I receive the data:
H1; fileID
H2; filedate
H3; sendernr
H4; receivernr
H5; product
H6; market
H7; version
F1; number of records
The way I want to store the data in a table:
fileID, filedate, sendernr, receivernr, product, market, version, number of
records
Does anybody have an idea on how to do this? I’ve tried but I can’t come up
with a solution.
Thanks a lot