<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: tSystem - sed command - I am close, just need a little help in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315105#M85794</link>
    <description>I think this works:&lt;BR /&gt;&lt;BR /&gt;context.myCommand="sed -i \":a;N;$!ba;s/\\\"\\n\\\"«/\\\"\\\"«/g\"&lt;BR /&gt;myFile.csv";&lt;BR /&gt;System.out.println(context.myCommand);&lt;BR /&gt;</description>
    <pubDate>Wed, 07 Nov 2018 01:14:33 GMT</pubDate>
    <dc:creator>talendtester</dc:creator>
    <dc:date>2018-11-07T01:14:33Z</dc:date>
    <item>
      <title>tSystem - sed command - I am close, just need a little help</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315101#M85790</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LKk8AAG"&gt;@lli&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;When I am in the command line, this command works on Windows for using the GNU sed:&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;sed -i ":a;N;$!ba;s/\"\n\"«/\"\"«/g" myFile.csv&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I have a 115GB file which has multiple row which are breaking to multiple lines.&lt;/P&gt; 
&lt;P&gt;I need to find and replace all occurrences of double quote new line character double quote and special character « (which is my delimiter).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;For example:&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;line_one_here&lt;STRONG&gt;"\n&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"«&lt;/STRONG&gt;the_rest_of_line_one_here&lt;/P&gt; 
&lt;P&gt;line_two_here&lt;/P&gt; 
&lt;P&gt;line_three_here&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am trying to get this to work in tSystem:&lt;/P&gt; 
&lt;P&gt;"sed -i &lt;STRONG&gt;\&lt;/STRONG&gt;":a;N;$!ba;s/\"\n\"«/\"\"«/g&lt;STRONG&gt;\&lt;/STRONG&gt;" "+ context.myFile&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Error is:&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;sed: -e expression #1, char 12: unterminated `s' command&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Similar to this post:&lt;/STRONG&gt;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCq5NCAS" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/Not-able-to-run-Linux-command-using-tSystem-Component/td-p/106483&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 23:26:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315101#M85790</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2018-11-06T23:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: tSystem - sed command - I am close, just need a little help</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315102#M85791</link>
      <description>&lt;P&gt;Whats wrong with the line breaks?&lt;/P&gt;&lt;P&gt;It is not a problem for parsing CSV!&lt;/P&gt;&lt;P&gt;If the values are capsulated in an exclosure like " the line break does not disturb will be treated simple as content.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 00:21:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315102#M85791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-07T00:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: tSystem - sed command - I am close, just need a little help</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315103#M85792</link>
      <description>&lt;P&gt;The problem is when the 115GB file was created, the .csv option wasn't turned on &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 00:34:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315103#M85792</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2018-11-07T00:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: tSystem - sed command - I am close, just need a little help</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315104#M85793</link>
      <description>&lt;P&gt;I have done a quick check what is the result of your sed java expression:&lt;/P&gt; 
&lt;P&gt;In a tJava:&lt;/P&gt; 
&lt;PRE&gt;System.out.println("sed -i&amp;nbsp;\":a;N;$!ba;s/\"\n\"«/\"\"«/g\" ");&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;The result is:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;sed -i ":a;N;$!ba;s/"
"«/""«/g" &lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;It does not looks like your original working command line above.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Your problem is the line break misused currently. Try this as java expression in the tSystem component.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;"sed -i \":a;N;$!ba;s/\\\"\\n\\\"«/\\\"\\\"«/g\" "&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;compared to your working command from your post:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;PRE&gt;sed -i ":a;N;$!ba;s/\"\n\"«/\"\"«/g"&lt;/PRE&gt; 
&lt;P&gt;this is the result of my changed java escaped command line:&lt;/P&gt; 
&lt;PRE&gt;sed -i ":a;N;$!ba;s/\"\n\"«/\"\"«/g"&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN&gt;I suggest you are trying your expression and print it out with System.out.println and tweak it until it looks like your expected command line.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 00:47:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315104#M85793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-07T00:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: tSystem - sed command - I am close, just need a little help</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315105#M85794</link>
      <description>I think this works:&lt;BR /&gt;&lt;BR /&gt;context.myCommand="sed -i \":a;N;$!ba;s/\\\"\\n\\\"«/\\\"\\\"«/g\"&lt;BR /&gt;myFile.csv";&lt;BR /&gt;System.out.println(context.myCommand);&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Nov 2018 01:14:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315105#M85794</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2018-11-07T01:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: tSystem - sed command - I am close, just need a little help</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315106#M85795</link>
      <description>&lt;P&gt;Where the hell is my response? I have for about an hour send your exactly this answer!&lt;/P&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;HR /&gt; 
 &lt;A href="https://community.qlik.com/s/profile/0053p000007LKjjAAG"&gt;@talendtester&lt;/A&gt;&amp;nbsp;wrote: 
 &lt;BR /&gt;I think this works: 
 &lt;BR /&gt; 
 &lt;BR /&gt;context.myCommand="sed -i \":a;N;$!ba;s/\\\"\\n\\\"«/\\\"\\\"«/g\" 
 &lt;BR /&gt;myFile.csv"; 
 &lt;BR /&gt;System.out.println(context.myCommand); 
 &lt;BR /&gt; 
 &lt;HR /&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 01:23:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315106#M85795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-07T01:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: tSystem - sed command - I am close, just need a little help</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315107#M85796</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LKk8AAG"&gt;@lli&lt;/A&gt;&amp;nbsp;thank you for your fast help!&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Not sure, I got the email update notice and I attempted to respond to it (instead of the earlier post) but the forums gave me a message saying I didn't have permissions and then when I refreshed the page your newer post was gone.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 17:31:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tSystem-sed-command-I-am-close-just-need-a-little-help/m-p/2315107#M85796</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2018-11-07T17:31:58Z</dc:date>
    </item>
  </channel>
</rss>

