Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / February 2007

Tip: Looking for answers? Try searching our database.

Importing records containing carriage returns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 14 Feb 2007 15:21 GMT
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.
Peter Jamieson - 14 Feb 2007 17:43 GMT
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
> Hi
> I'm trying to import a text file created using the Progress Report
[quoted text clipped - 7 lines]
>
> Any help please.
Steve - 15 Feb 2007 14:30 GMT
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?

On 14 Feb, 17:43, "Peter Jamieson" <p...@KillmapSpjjnet.demon.co.uk>
wrote:
> 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.
[quoted text clipped - 38 lines]
>
> - Show quoted text -
Peter Jamieson - 15 Feb 2007 14:55 GMT
Do you still see this problem if you enclose your multiline fields in double
quotes? And can you do that?

Peter Jamieson

> 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
[quoted text clipped - 57 lines]
>>
>> - Show quoted text -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.