<?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: How do you use a context variable in tSystem component? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324386#M94095</link>
    <description>tFileCopy would take a long time to run for large files.
&lt;BR /&gt;It looks like my job is getting the values but its failing on the tSystem:
&lt;BR /&gt;
&lt;B&gt;The system cannot find the file specified.&lt;/B&gt;
&lt;BR /&gt;tContextLoad_1 set key "newFileName" with value "#$%&amp;amp;-_+.txt"
&lt;BR /&gt;tContextLoad_1 set key "newFileName" with value "BatchFile.bat"
&lt;BR /&gt;tContextLoad_1 set key "newFileName" with value "testFile.txt"
&lt;BR /&gt;.-----------+-------------+-----------+---------------.
&lt;BR /&gt;| tLogRow_1 |
&lt;BR /&gt;|=----------+-------------+-----------+--------------=|
&lt;BR /&gt;|key2 |value2 |key |value |
&lt;BR /&gt;|=----------+-------------+-----------+--------------=|
&lt;BR /&gt;|newFileName|#$%&amp;amp;-_+.txt |oldFileName|!@#$%&amp;amp;()-_+.txt|
&lt;BR /&gt;|newFileName|BatchFile.bat|oldFileName|BatchFile.bat |
&lt;BR /&gt;|newFileName|testFile.txt |oldFileName|testFile.txt |
&lt;BR /&gt;'-----------+-------------+-----------+---------------'</description>
    <pubDate>Fri, 19 Jul 2013 22:29:52 GMT</pubDate>
    <dc:creator>talendtester</dc:creator>
    <dc:date>2013-07-19T22:29:52Z</dc:date>
    <item>
      <title>How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324374#M94083</link>
      <description>I have two context variables which are assigned values:
&lt;BR /&gt;
&lt;B&gt;context.oldFileName&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;context.newFileName&lt;/B&gt;
&lt;BR /&gt;I want DOS to rename the old file name with the new file name.
&lt;BR /&gt;I think my tSystem component Command should look something like this:
&lt;BR /&gt;
&lt;B&gt;"cmd /c echo "+ context.oldFileName+ context.newFileName+" "&lt;/B&gt;
&lt;BR /&gt;or this:
&lt;BR /&gt;
&lt;B&gt;cmd /c REN %oldFileName% %newFileName%&lt;/B&gt;
&lt;BR /&gt;When I run the Command "
&lt;B&gt;cmd /c echo "+ context.oldFileName+ context.newFileName+" "&lt;/B&gt;
&lt;BR /&gt;The result is "nullnull"
&lt;BR /&gt;How do I get the tSystem to know the values of context.oldFileName and context.newFileName?</description>
      <pubDate>Fri, 12 Jul 2013 19:26:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324374#M94083</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2013-07-12T19:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324375#M94084</link>
      <description>I think the problem is not with tSystem itself (since that command works fine for me) but with some other aspect of your job design.  How do you assign the context variable values?  Can you print them with tJava or tContextDump?  Screenshot your job...</description>
      <pubDate>Sat, 13 Jul 2013 13:09:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324375#M94084</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-07-13T13:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324376#M94085</link>
      <description>It does sound like a variable assignment issue.&lt;BR /&gt;Don't forget that Talend provides components to do this type of stuff tFile* which is preferable to dropping out to the OS</description>
      <pubDate>Sun, 14 Jul 2013 12:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324376#M94085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-14T12:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324377#M94086</link>
      <description>Hi 
&lt;BR /&gt;Try this code for me it is working fine: 
&lt;BR /&gt; 
&lt;B&gt;"cmd /c ren " +context.oldfile+ " "+context.newfile&lt;/B&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;thanks 
&lt;BR /&gt; 
&lt;B&gt;&lt;FONT color="#0B4C5F"&gt;&lt;I&gt;Anil Kumar Burri&lt;/I&gt;&lt;/FONT&gt;&lt;/B&gt; 
&lt;FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;A href="http://anilkumarburri.wordpress.com/" rel="nofollow noopener noreferrer"&gt;http://anilkumarburri.wordpress.com/&lt;/A&gt;</description>
      <pubDate>Mon, 15 Jul 2013 06:01:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324377#M94086</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-15T06:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324378#M94087</link>
      <description>Here is my current tSystem code:
&lt;BR /&gt;"cmd /c REN %oldFileName% %newFileName%"
&lt;BR /&gt;
&lt;B&gt;The job runs without errors, but the files aren't being renamed, the file names stay the same:&lt;/B&gt;
&lt;BR /&gt;
&lt;BR /&gt;Starting job FileRename at 11:02 15/07/2013.
&lt;BR /&gt;
&lt;BR /&gt; connecting to socket on port 3659
&lt;BR /&gt; connected
&lt;BR /&gt;tContextLoad_1 set key "oldFileName" with value "test1.txt"
&lt;BR /&gt;tContextLoad_2 set key "newFileName" with value "test1new.txt"
&lt;BR /&gt;tContextLoad_1 set key "oldFileName" with value "test2.txt"
&lt;BR /&gt;tContextLoad_2 set key "newFileName" with value "test2new.txt"
&lt;BR /&gt;tContextLoad_1 set key "oldFileName" with value "test3.txt"
&lt;BR /&gt;tContextLoad_2 set key "newFileName" with value "test3new.txt"
&lt;BR /&gt; disconnected
&lt;BR /&gt;Job FileRename ended at 11:02 15/07/2013.</description>
      <pubDate>Mon, 15 Jul 2013 17:07:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324378#M94087</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2013-07-15T17:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324379#M94088</link>
      <description>Screenshot your job</description>
      <pubDate>Mon, 15 Jul 2013 17:08:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324379#M94088</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-07-15T17:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324380#M94089</link>
      <description>Here 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEc6.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133384iB61F2C1E9FED4172/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEc6.jpg" alt="0683p000009MEc6.jpg" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEn3.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/130311i5701900FA39C918D/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEn3.jpg" alt="0683p000009MEn3.jpg" /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 15 Jul 2013 18:24:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324380#M94089</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2013-07-15T18:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324381#M94090</link>
      <description>Can't see anything obvious wrong but it's certainly an unusual design. Would need more info on what you're trying to do in each component but have you tried using an Array Command in tSystem?</description>
      <pubDate>Mon, 15 Jul 2013 18:31:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324381#M94090</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-07-15T18:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324382#M94091</link>
      <description>I am trying to 
&lt;B&gt;clean out weird characters&lt;/B&gt; from the files names, such as these characters "!@#$%&amp;amp;()-_+" and I want to remove any periods except the file extension tag. 
&lt;BR /&gt;I am doing the filename clean up in the tMap. For example to get rid of the @ sign I use: 
&lt;BR /&gt;row3.fileName.replaceAll("@","").trim()</description>
      <pubDate>Mon, 15 Jul 2013 18:43:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324382#M94091</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2013-07-15T18:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324383#M94092</link>
      <description>Hi,&lt;BR /&gt;I simulate a simple one like&lt;BR /&gt;Fileinputdelimited--&amp;gt;contextload--&amp;gt;system&lt;BR /&gt;with code &lt;BR /&gt;&lt;PRE&gt;"cmd /c ren "+context.oldfile+" "+context.newfile&lt;/PRE&gt;&lt;BR /&gt;it works fine. And name of file changed.&lt;BR /&gt;i think that you should try  to put tsys in the end of this job.&lt;BR /&gt;like onsubjectok of tfilelist? or use tpostjob?&lt;BR /&gt;because in the screen shot i saw tcontextload for filepath ran faster than the others and you connected it to tsys. so...&lt;BR /&gt;Try it</description>
      <pubDate>Fri, 19 Jul 2013 11:02:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324383#M94092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-19T11:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324384#M94093</link>
      <description>Why not just use tFileCopy?&lt;BR /&gt;It supports rename and keeps everything 'talend' and is cross platform.</description>
      <pubDate>Fri, 19 Jul 2013 11:48:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324384#M94093</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-07-19T11:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324385#M94094</link>
      <description>Don't forget that Talend provides components to do this type of stuff tFile* which is preferable to dropping out to the OS</description>
      <pubDate>Fri, 19 Jul 2013 14:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324385#M94094</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-07-19T14:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324386#M94095</link>
      <description>tFileCopy would take a long time to run for large files.
&lt;BR /&gt;It looks like my job is getting the values but its failing on the tSystem:
&lt;BR /&gt;
&lt;B&gt;The system cannot find the file specified.&lt;/B&gt;
&lt;BR /&gt;tContextLoad_1 set key "newFileName" with value "#$%&amp;amp;-_+.txt"
&lt;BR /&gt;tContextLoad_1 set key "newFileName" with value "BatchFile.bat"
&lt;BR /&gt;tContextLoad_1 set key "newFileName" with value "testFile.txt"
&lt;BR /&gt;.-----------+-------------+-----------+---------------.
&lt;BR /&gt;| tLogRow_1 |
&lt;BR /&gt;|=----------+-------------+-----------+--------------=|
&lt;BR /&gt;|key2 |value2 |key |value |
&lt;BR /&gt;|=----------+-------------+-----------+--------------=|
&lt;BR /&gt;|newFileName|#$%&amp;amp;-_+.txt |oldFileName|!@#$%&amp;amp;()-_+.txt|
&lt;BR /&gt;|newFileName|BatchFile.bat|oldFileName|BatchFile.bat |
&lt;BR /&gt;|newFileName|testFile.txt |oldFileName|testFile.txt |
&lt;BR /&gt;'-----------+-------------+-----------+---------------'</description>
      <pubDate>Fri, 19 Jul 2013 22:29:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324386#M94095</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2013-07-19T22:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324387#M94096</link>
      <description>So are the values getting to tSystem now?  Have you tried just echoing them?&lt;BR /&gt;Is the path correct?  Try just the "cd" command to check what path tSystem thinks it's in.</description>
      <pubDate>Sat, 20 Jul 2013 01:22:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324387#M94096</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2013-07-20T01:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do you use a context variable in tSystem component?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324388#M94097</link>
      <description>Not sure why it works, but it does!
&lt;BR /&gt;I ended up putting Iterate from the tFileInputDelimited to the tSystem.
&lt;BR /&gt;This is the tSystem command that worked for me:
&lt;BR /&gt;
&lt;B&gt;"cmd /c ren \""+context.oldFileName+"\" \""+context.newFileName+"\""&lt;/B&gt;</description>
      <pubDate>Mon, 22 Jul 2013 20:58:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-do-you-use-a-context-variable-in-tSystem-component/m-p/2324388#M94097</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2013-07-22T20:58:34Z</dc:date>
    </item>
  </channel>
</rss>

