Importing text file for mail merge

D

Dig

I have Word XP and some sent me a file to import for mailing labels.
Everytime I tried it just crashed Word. Finally I examined the txt
file itself and notices that it is one continuous stream of fields
seperated by commas deliniated by quotes.

So it starts off with Field names but at the last field name is a
comma and then starts the data. I seem to remember their should be an
enter after the last field name and before the first bit of data so I
tried that on a piece of the file.

I removed the comma and inserted an Enter. I was then able to merge
that piece of file perfectly. To double check it I copied the exact
same lines from the original txt file (without the enter after each
line) and copied it into a seperate file and tried to merge it and
Word crashed.

Is there a way to open a text file that is one continuous stream of
fields seperated by commas?

If not how in the world did someone export this? I even tried to open
it in Excel and Access and they both would not because of the way it
is layed out.

If I was right in adding the enter, anyone have any ideas on how to
fix the file without manually going through it?

Thanks for all your help
 
D

Doug Robbins - Word MVP

Hi Dig,

Open the file in Word, and from the Edit menu, select Replace and in the
Find what box, enter "," and in the Replace with box enter ^t

That will place a tab between each field. Now select all of the text and
from the Tables menu, select Convert Text to Table and in the number of
columns box, enter the number of data fields and press OK.

You should now end up with a Table that contains the field names in the
first row and each record will be on a separate row of the table. Save the
document and you can then use it as a datasource.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
S

Suzanne S. Barnhill

The first step may be unnecessary, since you can select the comma as a
separator when you Convert Text to Table. Set the number of columns to match
the data, and you should have a table that will work perfectly.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
D

Dig

Yippe Kay Ya!! That was incredible. It is hard to believe it could be that
simple but it worked perfectly. The only thing I did different was left the
commas in as Suzanne suggested and it worked great.

Thanks a million
 
D

Dig

Thanks for the reply Suzanne. I used Doug's suggestion and just left the
commas and it woeked great.
Thanks
 

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