<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/discussions/f/plug-ins/11278/export-sql-to-flat-file-text-format---column-value-with-space-is-coming-within-double-quotes</link><description>Hi All, 
 I am using Export SQL to Flat File Smart Service where for of the column we have large text value (A paragraph value with spaces) which is enclosed in &amp;quot;&amp;quot; automatically by the Smart service. 
 Other text values without spaces (E.g. Prakhar_Garg_09_10_2017</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49825?ContentTypeID=1</link><pubDate>Wed, 01 Nov 2017 07:04:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1ce15164-b9fe-4ddf-8144-d5172d131453</guid><dc:creator>PGarg</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;I got the root cause of this behaviour. This is happening due to &amp;quot;escapeCsv&amp;quot; function used to get the column value and this function has its own properties that if text includes comma/&amp;quot;&amp;quot;/new line then text will be enclosed in Quotes.&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/19/pastedimage1509519792337v2.png"&gt;&lt;img src="/resized-image/__size/352x99/__key/communityserver-discussions-components-files/19/pastedimage1509519792337v2.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html#escapeCsv-java.lang.String"&gt;https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html#escapeCsv-java.lang.String&lt;/a&gt;-&lt;/p&gt;
&lt;p&gt;I will be stripping comma/&amp;quot;&amp;quot;/new line before saving the data into database and then when this Plugin will be used for creating file, it will not have any issue (Tested and working fine).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49615?ContentTypeID=1</link><pubDate>Tue, 24 Oct 2017 06:09:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f5900464-a344-483e-acf4-8f20802edd61</guid><dc:creator>PGarg</dc:creator><description>Yes I tried Cast function but still getting text enclosed in Double Quotes&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49596?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 13:17:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0549f50d-6789-41be-a4f6-82588f661ce0</guid><dc:creator>amyw</dc:creator><description>In your Select query, have you tried setting the column as: cast(COLUMN_NAME as char)?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49592?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 09:44:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:19444a73-0958-4b85-b302-a5acdda49193</guid><dc:creator>PGarg</dc:creator><description>No, I can&amp;#39;t see 10, 13 or 9 in the list&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49591?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 09:35:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7ff5cded-f3a6-46f3-a9ff-0b3563474366</guid><dc:creator>Vinay Kumar Rai</dc:creator><description>Yes it return unicode characters, can you please verify the number 13,10 or 9, is present or not on the text&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49590?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 09:08:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c138e1d1-324e-49f0-8c2a-fa8438a0aba5</guid><dc:creator>PGarg</dc:creator><description>Hi Vinay,&lt;br /&gt;
&lt;br /&gt;
CODE function in Appian will convert each character of the text provided into its Unicode, so this will not help as if I provide my complete statement it will return list of number integers (As per function definition).&lt;br /&gt;
&lt;br /&gt;
code(&lt;br /&gt;
&amp;quot;Hello Everyone a New project has been started by user with following comments XYZ&amp;quot;&lt;br /&gt;
) - This will return list of 81 number integer (where 81 is number of characters in text)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49589?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 08:28:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:944a542e-1a2c-4fe7-be2c-a9381aa80d36</guid><dc:creator>Vinay Kumar Rai</dc:creator><description>&lt;p&gt;as I already mention use CODE function in Appian Expression Editor,&lt;br /&gt;just copy the text from the database and see weather you get any special characters &lt;br /&gt;code(&lt;br /&gt;&amp;quot;Hello Everyone a New project has been started by user with following comments XYZ&amp;quot;&lt;br /&gt;),&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the database you can not see the Unicode Characters directly&amp;nbsp;&lt;/p&gt;
&lt;p&gt;on the database end you can also try below code to find the newline characters&lt;/p&gt;
&lt;pre class="lang-sql prettyprint prettyprinted"&gt;&lt;code&gt;&lt;span class="kwd"&gt;select&lt;/span&gt; &lt;span class="pun"&gt;*&lt;/span&gt;
&lt;span class="kwd"&gt;from&lt;/span&gt;&lt;span class="pln"&gt; YourTable
&lt;/span&gt;&lt;span class="kwd"&gt;where&lt;/span&gt;&lt;span class="pln"&gt; Col1 &lt;/span&gt;&lt;span class="kwd"&gt;like&lt;/span&gt; &lt;span class="str"&gt;&amp;#39;%&amp;#39;&lt;/span&gt; &lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; char&lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="lit"&gt;10&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt; &lt;span class="pun"&gt;+&lt;/span&gt; &lt;span class="str"&gt;&amp;#39;%&amp;#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49588?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 08:21:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8e89e549-37c5-49c8-ad2f-65c8cb0bdd03</guid><dc:creator>PGarg</dc:creator><description>How to validate for the Unicode characters from database? We have simple statement like &amp;quot;Hello Everyone a New project has been started by user with following comments XYZ&amp;quot; as on of the column value which is getting enclosed in &amp;quot;&amp;quot;, but if I reduce the same to &amp;quot;Hello Everyone&amp;quot; no &amp;quot;&amp;quot; are appearing.&lt;br /&gt;
&lt;br /&gt;
if I run the same Select query directly in DB I can see the data correctly, but same data in text file is corrupted.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49587?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 07:23:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f337f47a-979e-4b5f-9ed4-c2c1bc88fc13</guid><dc:creator>Vinay Kumar Rai</dc:creator><description>I think you get some unicode characters from the database, &lt;br /&gt;
for debugg please copy the text from the database table and in the appian side used CODE to check if any unicode charcters are present in the text  like 10,13,9&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49584?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 07:05:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:484399d1-1a5a-4378-b41c-1e64fa9a2f67</guid><dc:creator>PGarg</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
I am just using simple Select query to get the specific columns and corresponding values from database&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49578?ContentTypeID=1</link><pubDate>Sat, 21 Oct 2017 18:00:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d745c38-ccdb-4858-a756-7541c212b30a</guid><dc:creator>Jamal Case</dc:creator><description>Can you share how you configured the &amp;quot;SQL&amp;quot; parameter in the &amp;quot;Export SQL to Flat File&amp;quot; smart service?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49577?ContentTypeID=1</link><pubDate>Sat, 21 Oct 2017 14:08:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0208d09b-8471-436c-b622-0b5bd6c3a72f</guid><dc:creator>PGarg</dc:creator><description>Thanks for the response,&lt;br /&gt;
&lt;br /&gt;
The behaviour of the Plugin is quite weird.&lt;br /&gt;
&lt;br /&gt;
For one of the column having long statements as value, the value is getting enclosed in &amp;quot;&amp;quot; but in the same column if you have just 2 words like Prakhar Garg then 1st word is coming in 1st line and automatically 2nd word comes in other line in txt file but without &amp;quot;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
I am getting values directly from table using sql script.&lt;br /&gt;
&lt;br /&gt;
I am not sure what I am missing.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49553?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2017 12:03:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bcd5b260-fe4a-4962-abf0-c4279e496969</guid><dc:creator>amyw</dc:creator><description>If you are getting the values directly from the database when using the Smart Service, you might not be able to use an Appian function. Have you tried using something like: SET Name = REPLACE(Name,&amp;#39; &amp;quot; &amp;#39;, &amp;#39; &amp;#39; ) in your SQL code to remove the quotes from that value? &lt;br /&gt;
Otherwise, as Jamal said, you could consider using the stripwith() or cleanwith() functions before you save the values into the database to being with, which would remove this downstream issue.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49552?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2017 11:34:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c68aaa7e-2d62-4ce1-80c2-b07baa6086e2</guid><dc:creator>Jamal Case</dc:creator><description>&lt;p&gt;You could use the stripwith() or cleanwith() functions to remove the double quotes from that value in a script task right before you execute &amp;nbsp;the &amp;quot;Export SQL to Flat File&amp;quot; Smart Service. please refer to&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/17.3/fnc_text_cleanwith.html"&gt;https://docs.appian.com/suite/help/17.3/fnc_text_cleanwith.html&lt;/a&gt; &amp;nbsp;and&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/17.3/fnc_text_stripwith.html"&gt;https://docs.appian.com/suite/help/17.3/fnc_text_stripwith.html&lt;/a&gt;&amp;nbsp;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export SQL to Flat File (Text Format) - Column Value with Space is coming within Double Quotes</title><link>https://community.appian.com/thread/49545?ContentTypeID=1</link><pubDate>Fri, 20 Oct 2017 06:24:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f40c65d9-8660-45da-aa91-7da9ca66725e</guid><dc:creator>PGarg</dc:creator><description>Value is getting saved exactly same (with double quotes) which is causing issue in downstream system.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>