how do I import rows of text data into Access?

G

Guest

A piece of test equipment returns a Text file with data in row format instead
of column. How can I import (append) this data into an Access table? Each
new file represents a "record" and each row row of text needs to populate a
"field".
 
J

John Nurick

Without knowing exactly how the file is laid out it's not possible to be
precise. Sometimes it's best to import data such as this into a tall
narrow table with three fields, e.g.
tblReadings
ReadingID* (e.g. the name of the file from which it was imported)
PropertyName* (identifies the row of the original textfile)
PropertyValue
and then use a crosstab when you need to display multiple fields from
each reading on a single row.

If you do need to flatten it at this stage, then if the textfile is laid
out something like this
Field1: Value1
Field2: Value2
...
you can link it as a table with two fields [Fieldname] and [Value] and
then create a crosstab query to "flatten" it into a single record, and
finally convert the crosstab into an append query.

Otherwise, it's a matter of writing VBA code to read the file line by
line assembling the data for a record and finally appending it to the
table.

Otherwise,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top