parsing text file, and generating distinct cell values

G

gerridge

I've got a text file that's not delimited in any way that makes it
easy to manipulate.

It looks exactly like this...

1. CONTACT INFORMATION:
-----------------------
Company Name: IBM
Industry Type: Consulting
Street Address: 300 E. 54th St Floor#: 10 Suite #: 0
City: New York
State: NY ZIP + 4: 10021 - 0000

Contact1: John Doe
Title1: Vice President
Phone1: (212) 555-4451
Email1: (e-mail address removed)

.... with this contact information for hundreds of companies (each
distinct set of company values preceded by the "1. CONTACT
INFORMATION:" header).

What I'd like to do is parse the file, and generate separate cell
values for the data included. So, the above information would appear
in one row, with separate cells for the data appearing in "Company
Name", "Industry Type", "Street Address", etc... The next row in file
would have the values for the next company in the text file.

I can load the file into VBA, but I can't figure how to parse it in
the way I need. Even though there are certain rows with multiple data
values (e.g., "state" & "zip") it would be enough to create a cell
value for each row and leave state & zip glommed together.

Any idea as to how this could be accomplished?

Thanks,
-DG
 

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