Importing records containing carriage returns

S

Steve

Hi
I'm trying to import a text file created using the Progress Report
Builder into a Word 2003 mail merge document. I've done this without
any problem before but because each record in this text file has
between four and ten lines each ending with a carriage return
character Word won't let me do it. I keep getting the error 'record n
contained too few data fields'. I'm setting the field delimeter to #
and the record delimeter to $ so surely it shouldn't matter fi each
record contains up to 10 carriage returns.

Any help please.
 
P

Peter Jamieson

In principle that's correct, as long as # and $ do not appear in your data
and you use Word's text file converter to get the data.

However, you will also get problems if there are any double-quote characters
in your data and they are not being used as the "text delimiter", i.e. to
surround complete fields, and there may be other similar issues.

I would be inclined to wrap up every field that might contain #,$," or enter
in double-quotes and double up any double-quotes in the data. I don't think
it will make much difference which field and record delimiters you use after
that and comma and enter will probably be fine.

e.g. instead of

ID#name#address$1#us#11 "The Maltings"
in the middle of the street
ourtown$

try

ID,name,address
1,"us","11 """The Maltings""
in the middle of the street
ourtown"
etc.

Are there any other output format options that you can choose in the
Progress Repoert Builder (whatever that may be) ?

Peter Jamieson
 
S

Steve

Thanks for that. I've realised what it is now. Each record can have
a random number of lines in the text file, anything from 10 to 30. So
if the first record in the text file contains 30 records, any
subsequent record with less than that number of records produces the
'record n contained too few data fields' errors.

So the first record in my text file will have to be a dummy record
with the maximum number of possible lines and merging to a new
document means that I will get this error for each record in the text
file. As there might be up to 1,000 record in this file, does anyone
know how to turn this message off?
 
P

Peter Jamieson

Do you still see this problem if you enclose your multiline fields in double
quotes? And can you do that?

Peter Jamieson
 

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