Importing a Text File (Parsing)

  • Thread starter Thread starter Wally S
  • Start date Start date
W

Wally S

I have a text file that is generated by a computer system
so is not changeable but I want to be able to pull data
off of that form and into MS Excel so I can do some
charting and graphing.

The format looks like the following


Node ID: TEAM1
Date Generated: 11 Oct 03
Group StatusA StatusB Status C Status D
Red 1 2 3 4
Blue 2 3 4 5
Orange 5 6 7 8


Node ID: TEAM1
Call Rate
FROM HI MED LOW OTHER
TEAM2 33 109 1221 1
TEAM3 5 789 4000 0
TEAM4 1 23 109 300

I want to automate the process of pulling out the data
such as the Groups and their status's and the Call Rate by
team and priority. If I can get from the text file to
Excel, I can then get it in to an Access Database.

I think it has something to do with programatically
parsing or something, but really unsure and would
appreciate any assistance. Please reply to both this
server and to my Email at iliketolearn6@REMOVEALLCAPS
hotmail.com

Thanks again

Wally S
 
If you want it in an Access database why don't you import it into Access?

The Access import wizard is ideal for these types of files.

P
 
I would import it into Access, but the real issue is
parsing out the data in a format that will allow me to
bring it in to Access or Excel. I the format it is
currently in, it will not import very well into Access
since in Access it needs to be one record in a table. If
there is a way to parse the data straight from a text file
into Access I would certainly appreciate assistance doing
it that way as well. Again, I appreciate all assistance
and advice

Wally
 
How is your database set up? The sample you included looks like it
should go into two different tables in Access, and could be normalized
in Excel. For that, you could use the technique described by John
Walkenbach:
http://j-walk.com/ss/excel/usertips/tip068.htm

With that technique, and a bit of code, your first table might be ready
for export to Access:

Team Group Status Score
Team1 Red StatusA 1
Team1 Red StatusB 2
 
Back
Top