Importing Text File?

  • Thread starter Thread starter Vik Rubenfeld
  • Start date Start date
V

Vik Rubenfeld

I'm a newbie to Access. A client asked me to import a large tab text
file (2mb, around 700 fields per row) into Access. I opened Access,
created a new database, and selected Get External Data from the File
menu. I clicked on my data file, the Open File dialog box closed and
then... nothing happened. The data didn't appear to be imported. I'm
sure the right way to do this must be the most obvious thing in the
world to a regular Access user.

What is the correct way to import at tab text file into Access? Thanks
in advance for any info.


-Vik
 
Vik,

You went the right way, but couldn't complete the import because of the
number of fields; a table in Access can have up to 255 fields, so trying
to import 700 into a table won't work. Given the 255 field restriction,
you will definitely have to break up the data into several tables, now
the tricky part is how you work with the original text file. One thing
to try would be to use VBA to open the text fiel and work with the lines
one by one (but even this is not guaranteed to work if the lines are too
long). If it works, you could either save parts of each line in
different text files and then import separately, or use recordset
operations to populate your tables directly.

HTH,
Nikos
 
Before you go to all that trouble - and trouble it would be if you are not
familiar with using VBA & the recordset object, I would explain to your
client the limitations of ACCESS, and make sure that none of the fields
they want importing are extraneous, or if there is any grouping to the data
so you can import it into separate tables and create relationships between
them.
 
Hi Vik,

If you download the Gnu utilities from http://unxutils.sourceforge.net/
you can use "cut" to divide the file into several narrower ones that can
be imported into separate Access tables.

Alternatively, if you have or can install Perl on your computer, I can
send you a command-line program that will convert the 700-field file
into a single tall-narrow file that can be imported into Access and used
as the basis of a normalised data structure.
 
Back
Top