importing cell range from irregular .txt/.csv

E

Evan Morris

So I have a massive amount of data files I am trying to compile together into a database. The appropriate structure of the database itself is an issue, but I have far more pressing problem that I will have to tackle before I can do anything else.

The data files represent conditions and results for discreet "runs". Each run gets 2 data files. One is a tab delimited .txt and the other is a .csv.

The .txt file is laid out like this

i = Field identifier
f = Field/data
= blank space

an identifier applies to data below it

i i i i i
f f f f f

i i i i i
f f f f f

i i i i i
f f f f f
f f f f f
f f f f f
f f f f f
f f f f f
f f f f f

The second file (.csv) looks like this:

i f
i f

i i i i i i i i i i
f f f f f f f f f f
f f f f f f f f f f
f f f f f f f f f f

where the top two identifiers/field combos apply left to right, the other ones are vertical.
--------------

Anywho. Is there ANY way to import these files without severely reformating my data and/or write some VBA stuff to pull it in?

Ugh, I wish I could catch the people that made these data files before they generated years of data in these terrible formats.


Submitted via EggHeadCafe - Software Developer Portal of Choice
SQL Server Stored Procedure Scripts By Dependency
http://www.eggheadcafe.com/tutorial...8-37aad7fc9103/sql-server-stored-procedu.aspx
 
G

GeoffG

To program the reading of a text file and write the data to
an Access table:

1. With a reference to "Microsoft Scripting Runtime" (in
the VBA editor), you could use the TextStream object to read
a text file. The following article gives a code example:

http://msdn.microsoft.com/en-us/library/aa263346(VS.60).aspx

2. The VBA Split() function may help you chop up a line
after reading it.

3. You could write data to an Access table using the
methods in the "Microsoft DAO Object Library".

Success may depend on whether the data has been written to
the text files consistently.

Programming a solution may be a challenge if you don't
already have skills in these areas.
Suggest you explore the Microsoft website for coding
examples.

Geoff




in message
news:[email protected]...
 

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