Import a Word doc to Access table

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I have a large Word document with over 1000 contact information and it is in
the following format:

FirstName:John
LastName:Doe
Address1:Suite 1000
Address2:123 Main Street
City:New York
Zip:234578
Telephone:123-254-4567

FirstName:Jan
MiddleName:Liz
LastName:Doe
Address1:12345 Avenue
City:New York
Zip:362547
Telephone:235-154-4512

Some have more contact information than the others, however majority of it
is in the same format like the first one. I need to import it to an Access
table. Thanks
 
Paul said:
I have a large Word document with over 1000 contact information and
it is in the following format:

FirstName:John
LastName:Doe
Address1:Suite 1000
Address2:123 Main Street
City:New York
Zip:234578
Telephone:123-254-4567

FirstName:Jan
MiddleName:Liz
LastName:Doe
Address1:12345 Avenue
City:New York
Zip:362547
Telephone:235-154-4512

Some have more contact information than the others, however majority
of it is in the same format like the first one. I need to import it
to an Access table. Thanks

This can be done in code and is not hard to do, just busy work.
If you are fairly new to Access it's a good learning experience.
However below is a no code way.


WORK WITH A COPY.
Add dummy address2 lines to the first ten or more records. If teh number is
small do it for all the records.
^p is th paragraph mark.
Do a Search and replace (S&R) to find any commas and get rid of them.
Delete the first "FirstName:"
S&R "^pLastName:" with a comma.
S&R "^pAddress1:" with a comma.
Do the same for Address2,city,zip,telephone and lastly for the firstname.
Since there are two paragraph marks after the telephone number you will now
have a comma deliminted file.

Import this.
You will have some bad records with the city where address2 is, etc.
Build a query with the criteria for the telephone number is Null.
This should give all the bad records.
Use this query and update the telephone number with the ZIP field, then the
ZIP field with the city field until everything is in the right place.
 
Back
Top