<?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: File Data Type: Dynamic - Execute Unix Commands through tSystem and compare the output to create a log file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355177#M120984</link>
    <description>Hi 
&lt;BR /&gt;I don't understand the commends you are using to validate the header, what's the output of global variables? Try to print the value on a tJava to see if they are expected values.
&lt;BR /&gt;tSystem1--oncomponentok--tsystem2--oncomponentok--tjava
&lt;BR /&gt;
&lt;BR /&gt;Shong
&lt;BR /&gt;</description>
    <pubDate>Tue, 17 Jul 2018 07:46:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-07-17T07:46:23Z</dc:date>
    <item>
      <title>File Data Type: Dynamic - Execute Unix Commands through tSystem and compare the output to create a log file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355174#M120981</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to validate whether the header of file is expected or not. The expected header is passed as a context variable.&lt;/P&gt;&lt;P&gt;As i am using dynamic data type while reading the file, i cannot process it by any other means.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Input File - a.txt&lt;BR /&gt;A,B,C&lt;BR /&gt;1,2,3&lt;BR /&gt;4,5,6,7&lt;BR /&gt;8,9&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Below commands were used, and output of tsystem is stored in global variables. But when the global variables are compared in tmap, log file is always created irrespective of whether the header matches or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tSystem1 --&amp;gt;(main) tSystem2 --&amp;gt;&lt;SPAN&gt;(main)&lt;/SPAN&gt; tMap --&amp;gt;&lt;SPAN&gt;(main)&lt;/SPAN&gt; tOutputFileDelimited&lt;BR /&gt;&lt;BR /&gt;tSystem1 - "/bin/bash -c echo " + context.Header&lt;BR /&gt;tSystem2 - "/bin/bash -c echo `head -1 " + context.InputFile + "`"&lt;BR /&gt;tMap -&amp;nbsp;((String)globalMap.get("tSystem_1_OUTPUT")).equals(((String)globalMap.get("tSystem_2_OUTPUT"))) ? 0 : 1&amp;nbsp;&lt;BR /&gt;Link Condition - var == 1&lt;BR /&gt;Output Message -&amp;nbsp;Header not valid&lt;BR /&gt;&lt;SPAN&gt;tOutputFileDelimited - Create a log file&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;But, somehow, even when the header is as expected, the log file is created with output message.&lt;BR /&gt;What am i missing here? Also, if there is any other way to achieve the same with dynamic data type of the file, please let me know!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:57:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355174#M120981</guid>
      <dc:creator>jaink</dc:creator>
      <dc:date>2024-11-16T07:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: File Data Type: Dynamic - Execute Unix Commands through tSystem and compare the output to create a log file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355175#M120982</link>
      <description>Hi 
&lt;BR /&gt;The global variables should be used after tSystem execution. Change the job to: 
&lt;BR /&gt;tSystem1--oncomponentok--tsystem2--oncomponentok--tFixeFlowInput--main--tMap--&amp;gt;tfileOutputDelimited 
&lt;BR /&gt; 
&lt;BR /&gt;on tFixedInputFlow: output the value of global variable, define two columns with string type. 
&lt;BR /&gt;c1 
&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;(String)globalMap.get("tSystem_1_OUTPUT")) 
&lt;BR /&gt;c2: ((String)globalMap.get("tSystem_2_OUTPUT")) 
&lt;BR /&gt; 
&lt;BR /&gt;Regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 17 Jul 2018 06:45:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355175#M120982</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-17T06:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: File Data Type: Dynamic - Execute Unix Commands through tSystem and compare the output to create a log file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355176#M120983</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/00539000004XsnJAAS"&gt;@shong&lt;/A&gt;&lt;/P&gt; 
&lt;P&gt;Even with this approach, the file is always created irrespective&amp;nbsp;whether the header is same or not!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jul 2018 06:59:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355176#M120983</guid>
      <dc:creator>jaink</dc:creator>
      <dc:date>2018-07-17T06:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: File Data Type: Dynamic - Execute Unix Commands through tSystem and compare the output to create a log file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355177#M120984</link>
      <description>Hi 
&lt;BR /&gt;I don't understand the commends you are using to validate the header, what's the output of global variables? Try to print the value on a tJava to see if they are expected values.
&lt;BR /&gt;tSystem1--oncomponentok--tsystem2--oncomponentok--tjava
&lt;BR /&gt;
&lt;BR /&gt;Shong
&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Jul 2018 07:46:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/File-Data-Type-Dynamic-Execute-Unix-Commands-through-tSystem-and/m-p/2355177#M120984</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-17T07:46:23Z</dc:date>
    </item>
  </channel>
</rss>

