[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mtos-dev
Subject:    RE: [Mtos-dev] removing new lines and empty lines
From:       "Mihai Bocsaru" <info () pro-it-service ! com>
Date:       2012-06-21 22:02:44
Message-ID: 045401cd4ff9$970fd2a0$c52f77e0$ () pro-it-service ! com
[Download RAW message or body]

This is a multipart message in MIME format.

[Attachment #2 (multipart/alternative)]
This is a multipart message in MIME format.


Thanks Charly!

 

I'm producing this:

 

"Name","Company","Phone","E-mail","Message"

<MTSQLComments query="SELECT comment_id FROM mt_comment, mt_entry WHERE \
(comment_entry_id = entry_id) AND (entry_id = '145')" \
unfiltered="1">"<mt:CommenterName>","<mt:If \
tag="CommentDataCompany"><mt:CommentDataCompany></mt:If>","<mt:If \
tag="CommentDataPhone"><mt:CommentDataPhone></mt:If>","<mt:CommenterEmail>","<mt:CommentBody \
convert_breaks="0" strip_linefeeds="1">"

</MTSQLComments>

 

My goal being to produce a CSV file which to include also pending comments and that \
could be done using Brad's SQL plugin.

 

I will file a feature request to be able to display pending comments using MT itself \
via a parameter on mt:Comments.

 

 

The only problem I'm having is that this portion:

 

"Kathia Jones","resTV","1102069876","","<p>Hi!<br />

I'm contacting you on behalf of. We were wondering if we could…<br />

Thanks!</p>"

 

 

Gets transformed to this due to the convert_breaks modifier:

 

"Kathia Jones","resTV","1102069876","","Hi!

I'm contacting you on behalf of. We were wondering if we could…

Thanks!"

 

 

But after passing the "strip_linefeeds" modifier, it does this:

 

"Kathia Jones","resTV","1102069876","","Hi!I'm contacting you on behalf of. We were \
wondering if we could…Thanks!"

 

 

On the content above it would have been nice to get an empty space in between the \
text from each line, like this:

 

"Kathia Jones","resTV","1102069876","","Hi! I'm contacting you on behalf of. We were \
wondering if we could… Thanks!"

 

 

Kind Regards,

Mihai Bocsaru

 

 

From: achaia3@gmail.com [mailto:achaia3@gmail.com] On Behalf Of Charlie Gorichanaz
Sent: 22 iunie 2012 00:55
To: Mihai Bocsaru
Cc: mtos-dev; pronet@ml.sixapart.com
Subject: Re: [Mtos-dev] removing new lines and empty lines

 

Given there are apparently no real standards for CSV files, I'm assuming you're going \
for something MS Excel might understand with little pain....

Have you tried something like this as the field value?:

"<$mt:EntryBody convert_breaks="0" strip_linefeeds="0" replace='"','""'$>",




—
Charlie Gorichanaz



On Thu, Jun 21, 2012 at 2:51 PM, Mihai Bocsaru <info@pro-it-service.com> wrote:

Dear Community,

 

Have you used MT to produce a CSV file?

 

If so, how can you strip the new lines and empty lines from the EntryBody or the \
CommentBody input?

 

P.S.

 

This could be added as an extra template modifier to MT ;)

 

Thanks,

Mihai

 


_______________________________________________
Mtos-dev mailing list
Mtos-dev@ml.sixapart.com
http://ml.sixapart.com/mailman/listinfo/mtos-dev

 


[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks \
Charly!<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I'm \
producing this:<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&quot;Name&q \
uot;,&quot;Company&quot;,&quot;Phone&quot;,&quot;E-mail&quot;,&quot;Message&quot;<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&lt;MTSQLComments \
query=&quot;SELECT comment_id FROM mt_comment, mt_entry WHERE (comment_entry_id = \
entry_id) AND (entry_id = '145')&quot; \
unfiltered=&quot;1&quot;&gt;&quot;&lt;mt:CommenterName&gt;&quot;,&quot;&lt;mt:If \
tag=&quot;CommentDataCompany&quot;&gt;&lt;mt:CommentDataCompany&gt;&lt;/mt:If&gt;&quot;,&quot;&lt;mt:If \
tag=&quot;CommentDataPhone&quot;&gt;&lt;mt:CommentDataPhone&gt;&lt;/mt:If&gt;&quot;,&quot;&lt;mt:CommenterEmail&gt;&quot;,&quot;&lt;mt:CommentBody \
convert_breaks=&quot;0&quot; \
strip_linefeeds=&quot;1&quot;&gt;&quot;<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&lt;/MTSQLComments&gt;<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>My goal \
being to produce a CSV file which to include also pending comments and that could be \
done using Brad's SQL plugin.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I will file \
a feature request to be able to display pending comments using MT itself via a \
parameter on mt:Comments.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The only \
problem I'm having is that this portion:<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&quot;Kathia \
Jones&quot;,&quot;resTV&quot;,&quot;1102069876&quot;,&quot;&quot;,&quot;&lt;p&gt;Hi!&lt;br \
/&gt;<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I'm \
contacting you on behalf of. We were wondering if we could…&lt;br \
/&gt;<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks!&lt;/p&gt;&quot;<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Gets \
transformed to this due to the convert_breaks modifier:<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&quot;Kathia \
Jones&quot;,&quot;resTV&quot;,&quot;1102069876&quot;,&quot;&quot;,&quot;Hi!<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I'm \
contacting you on behalf of. We were wondering if we could…<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks!&quot;<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>But after \
passing the "strip_linefeeds" modifier, it does this:<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&quot;Kathia \
Jones&quot;,&quot;resTV&quot;,&quot;1102069876&quot;,&quot;&quot;,&quot;Hi!I'm \
contacting you on behalf of. We were wondering if we \
could…Thanks!&quot;<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>On the \
content above it would have been nice to get an empty space in between the text from \
each line, like this:<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>&quot;Kathia \
Jones&quot;,&quot;resTV&quot;,&quot;1102069876&quot;,&quot;&quot;,&quot;Hi! I'm \
contacting you on behalf of. We were wondering if we could… \
Thanks!&quot;<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Kind \
Regards,<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Mihai \
Bocsaru<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal><b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span \
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> achaia3@gmail.com \
[mailto:achaia3@gmail.com] <b>On Behalf Of </b>Charlie Gorichanaz<br><b>Sent:</b> 22 \
iunie 2012 00:55<br><b>To:</b> Mihai Bocsaru<br><b>Cc:</b> mtos-dev; \
pronet@ml.sixapart.com<br><b>Subject:</b> Re: [Mtos-dev] removing new lines and empty \
lines<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal \
style='margin-bottom:12.0pt'>Given there are apparently no real standards for CSV \
files, I'm assuming you're going for something MS Excel might understand with little \
pain....<br><br>Have you tried something like this as the field \
value?:<br><br>&quot;&lt;$mt:EntryBody convert_breaks=&quot;0&quot; \
strip_linefeeds=&quot;0&quot; \
replace='&quot;','&quot;&quot;'$&gt;&quot;,<br><br><br><br><br \
clear=all>—<br>Charlie Gorichanaz<br><br><o:p></o:p></p><div><p class=MsoNormal>On \
Thu, Jun 21, 2012 at 2:51 PM, Mihai Bocsaru &lt;<a \
href="mailto:info@pro-it-service.com" target="_blank">info@pro-it-service.com</a>&gt; \
wrote:<o:p></o:p></p><div><div><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Dear \
Community,<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Have you \
used MT to produce a CSV file?<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>If so, how \
can you strip the new lines and empty lines from the EntryBody or the CommentBody \
input?<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>P.S.<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>This could \
be added as an extra template modifier to MT ;)<o:p></o:p></p><p class=MsoNormal \
style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks,<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Mihai<o:p></o:p></p><p \
class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>&nbsp;<o:p></o:p></p></div></div><p \
class=MsoNormal style='margin-bottom:12.0pt'><br>_______________________________________________<br>Mtos-dev \
mailing list<br><a href="mailto:Mtos-dev@ml.sixapart.com">Mtos-dev@ml.sixapart.com</a><br><a \
href="http://ml.sixapart.com/mailman/listinfo/mtos-dev" \
target="_blank">http://ml.sixapart.com/mailman/listinfo/mtos-dev</a><o:p></o:p></p></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>



_______________________________________________
Mtos-dev mailing list
Mtos-dev@ml.sixapart.com
http://ml.sixapart.com/mailman/listinfo/mtos-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic