Community Discussions and Support
Mailmerge multi-line output possible?

Sharkfin,

Thanks for replying.

My spreadsheet creates a 'record' that has either "NameAddressStatePostcodeCountry" or "We don't have an address for you" in a single cell, where in the first situation it places an ASCII CR/LF inbetween each of NameAddress etc... through the use of CHAR(10)  and then it is all exported as CSV or TSV.

If viewed in a text editor, each of those items appears on a new line. All the other spreadsheet cell contents are still separated by a comma, as in lines 1 and 3 in the example below:

Mr Yussof, Shaharin Yussof

3 Somewhere St

Hometown NSW 1234 Australia, 02 9552 1234, shaharin@mydomain.com

Thus, by definition, the  2nd and 3rd lines are interpreted as new records, even though they are bounded by the commas after Yussof and before the phone number, and therein lies is the problem.

What I'm looking for is, as you correctly stated, a way of somehow embedding a code for CR/LF into the text file that will cause PMail to produce a CR/LF when producing the mailmerge output. Maybe this explanation makes it a bit clearer. Maybe it's just in the too-hard basket, or even the impossible basket, and  I will have to not be so lazy, and separate the two groups - with and without addresses - and mailmerge them separately. It's just not as elegant a solution.

Thanks again anyway, for replying. 

<p>Sharkfin,</p><p>Thanks for replying.</p><p>My spreadsheet creates a 'record' that has either "NameAddressStatePostcodeCountry" or "We don't have an address for you" in a single cell, where in the first situation it places an ASCII CR/LF inbetween each of NameAddress etc... through the use of CHAR(10)  and then it is all exported as CSV or TSV. </p><p>If viewed in a text editor, each of those items appears on a new line. All the other spreadsheet cell contents are still separated by a comma, as in lines 1 and 3 in the example below:</p><blockquote><p>Mr Yussof, Shaharin Yussof</p><p>3 Somewhere St</p><p>Hometown NSW 1234 Australia, 02 9552 1234, shaharin@mydomain.com</p></blockquote><p>Thus, by definition, the  2nd and 3rd lines are interpreted as new records, even though they are bounded by the commas after Yussof and before the phone number, and therein lies is the problem.</p><p style="">What I'm looking for is, as you correctly stated, a way of somehow embedding a code for CR/LF into the text file that will cause PMail to produce a CR/LF when producing the mailmerge output. Maybe this explanation makes it a bit clearer. Maybe it's just in the too-hard basket, or even the impossible basket, and  I will have to not be so lazy, and separate the two groups - with and without addresses - and mailmerge them separately. It's just not as elegant a solution.</p><p>Thanks again anyway, for replying.  </p>

I would like the results of a mailmerge appear on multiple lines e.g.

The address we have on file for you is:

Name

Address

City State Postcode Country

The catch is that all of the above, necessarily, will have to be in one single field in a record because I have a spreadsheet that generates an alternative text, in the same field, if NO address is present.

However, when the spreadsheet is exported to a text/csv/tsv file, by definition it takes up multiple lines, and screws up the condition that requires the record to be on one line.

My question is "Is it possible to embed a carriage return and/or line-feed character into the field to generate the above output, and if so, what format should that character take?" In Excel it's simply "char(10)" as one parameter in the concatenate() function.

 Alternatively, is there some sort of an IF-THEN-ELSE statement that can be incorporated into the mailmerge message that could choose between one set of fields or another?

<p>I would like the results of a mailmerge appear on multiple lines e.g. </p><blockquote><p>The address we have on file for you is: </p><p>Name</p><p>Address</p><p>City State Postcode Country</p></blockquote><p>The catch is that <b>all of the above</b>, necessarily, will have to be <b>in one single field</b> in a record because I have a spreadsheet that generates an alternative text, in the same field, if NO address is present. </p><p>However, when the spreadsheet is exported to a text/csv/tsv file, by definition it takes up multiple lines, and screws up the condition that requires the record to be on one line. </p><p>My question is "<i>Is it possible to embed a carriage return and/or line-feed character into the field to generate the above output, and if so, what format should that character take?</i>" In Excel it's simply "char(10)" as one parameter in the concatenate() function.</p><p style=""> Alternatively, is there some sort of an IF-THEN-ELSE statement that can be incorporated into the mailmerge message that could choose between one set of fields or another? </p>

[quote user="Shaharin"]

I would like the results of a mailmerge appear on multiple lines e.g.

The address we have on file for you is:

Name

Address

City State Postcode Country

The catch is that all of the above, necessarily, will have to be in one single field in a record because I have a spreadsheet that generates an alternative text, in the same field, if NO address is present.

However, when the spreadsheet is exported to a text/csv/tsv file, by definition it takes up multiple lines, and screws up the condition that requires the record to be on one line.

My question is "Is it possible to embed a carriage return and/or line-feed character into the field to generate the above output, and if so, what format should that character take?" In Excel it's simply "char(10)" as one parameter in the concatenate() function.

 Alternatively, is there some sort of an IF-THEN-ELSE statement that can be incorporated into the mailmerge message that could choose between one set of fields or another?

[/quote]

OK, several things here - where to start?

Firstly, are you saying that your spreadsheet exports to a field that essentially consists of "NameAddress-or-alternative-textCityStatePostcodeCountry"? And that therefore you want to be able to have new line characters in that field?

Secondly, I don't understand (though I haven't tried to replicate what you're doing) how your CSV file has multiple lines per record. At the risk of treating you like an idiot - and I apologise in advance for this question but I think it needs to be explicitly stated - are you sure you haven't simply got "word wrap" enabled when you view the CSV?

The details of the abilities and limitations of mail merges are not within my current knowledge. I've rarely used it. I don't think you can do any sort of IF-THEN-ELSE nor do I know whether, if you are able to somehow include a CR/LF in the data, it would be displayed correctly. Perhaps someone else will post an answer to those points.

[quote user="Shaharin"]<P>I would like the results of a mailmerge appear on multiple lines e.g. </P><BLOCKQUOTE><P>The address we have on file for you is: </P><P>Name</P><P>Address</P><P>City State Postcode Country</P></BLOCKQUOTE><P>The catch is that <B>all of the above</B>, necessarily, will have to be <B>in one single field</B> in a record because I have a spreadsheet that generates an alternative text, in the same field, if NO address is present. </P><P>However, when the spreadsheet is exported to a text/csv/tsv file, by definition it takes up multiple lines, and screws up the condition that requires the record to be on one line. </P><P>My question is "<I>Is it possible to embed a carriage return and/or line-feed character into the field to generate the above output, and if so, what format should that character take?</I>" In Excel it's simply "char(10)" as one parameter in the concatenate() function.</P><P style=""> Alternatively, is there some sort of an IF-THEN-ELSE statement that can be incorporated into the mailmerge message that could choose between one set of fields or another? </P><P>[/quote]</P><P>OK, several things here - where to start?</P><P>Firstly, are you saying that your spreadsheet exports to a field that essentially consists of "NameAddress-or-alternative-textCityStatePostcodeCountry"? And that therefore you want to be able to have new line characters in that field?</P><P>Secondly, I don't understand (though I haven't tried to replicate what you're doing) how your CSV file has multiple lines per record. At the risk of treating you like an idiot - and I apologise in advance for this question but I think it needs to be explicitly stated - are you sure you haven't simply got "word wrap" enabled when you view the CSV?</P><P>The details of the abilities and limitations of mail merges are not within my current knowledge. I've rarely used it. I don't think you can do any sort of IF-THEN-ELSE nor do I know whether, if you are able to somehow include a CR/LF in the data, it would be displayed correctly. Perhaps someone else will post an answer to those points.</P>
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft