<?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: Append file value to filename in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204468#M5341</link>
    <description>&lt;P&gt;No luck, still the same -- "null-&amp;lt;today's date&amp;gt;-Exchange.json". Not sure what I'm missing; it can't be this difficult.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an existing&amp;nbsp;file with value "1" in my folder - /Users/zalibra/Desktop/S3Test/Batch_ID.csv. I just want to use that value to create a new file called "1-&amp;lt;today's date&amp;gt;-Exchange.json". Everything works except for the "1".&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Feb 2019 04:59:25 GMT</pubDate>
    <dc:creator>zalibra</dc:creator>
    <dc:date>2019-02-28T04:59:25Z</dc:date>
    <item>
      <title>Append file value to filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204466#M5339</link>
      <description>&lt;P&gt;Should be a simple task but does not seem to work.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I've created a file called Batch_ID.csv (can be .json, .xls, etc.) which has just one value -- a sequential ID I generate after every job -- and saved in my folder Users/zalibra/Desktop/S3Test. So, today's Batch_ID will have value 1, tomorrow's Batch_ID will have 2, day after tomorrow 3, etc. Each day, before I run the new batch, I delete the old files. So at any one point, there will be only one Batch_ID file in my folder.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I now want to create a new file pulling data from a website.&amp;nbsp;The filename of this new file should take the value from Batch_ID.csv and append to it. I put&lt;/P&gt; 
&lt;PRE&gt;"/Users/zalibra/Desktop/S3Test/" +(String)globalMap.get("/Users/zalibra/Desktop/S3Test/Batch_ID.csv") + "-" + TalendDate.getDate("CCYYMMDD") + "-Exchange.json"&lt;/PRE&gt; 
&lt;P&gt;in the File Name in tFileOutputJSON_1 but the filename is not using the Batch_ID value. tFileOutputJSON file is getting created with filename "null-&amp;lt;today's data&amp;gt;-Exchange.json"&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I know I'm messing up in "+(String)globalMap.get("/Users/zalibra/Desktop/S3Test/Batch_ID.csv") +"; does anyone have the right command?&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="null filename.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2qh.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128236i66E6269C8B306417/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2qh.jpg" alt="0683p000009M2qh.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 01:30:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204466#M5339</guid>
      <dc:creator>zalibra</dc:creator>
      <dc:date>2019-02-28T01:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Append file value to filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204467#M5340</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LLA0AAO"&gt;@zalibra&lt;/A&gt;&amp;nbsp;,can you try with below one instead of&amp;nbsp;&lt;SPAN&gt;(String)globalMap.get("/Users/zalibra/Desktop/S3Test/Batch_ID.csv") and let me know.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;((String)globalMap.get("tFileOutputDelimited_1_FILE_NAME"))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 04:26:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204467#M5340</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2019-02-28T04:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Append file value to filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204468#M5341</link>
      <description>&lt;P&gt;No luck, still the same -- "null-&amp;lt;today's date&amp;gt;-Exchange.json". Not sure what I'm missing; it can't be this difficult.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an existing&amp;nbsp;file with value "1" in my folder - /Users/zalibra/Desktop/S3Test/Batch_ID.csv. I just want to use that value to create a new file called "1-&amp;lt;today's date&amp;gt;-Exchange.json". Everything works except for the "1".&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 04:59:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204468#M5341</guid>
      <dc:creator>zalibra</dc:creator>
      <dc:date>2019-02-28T04:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Append file value to filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204469#M5342</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LLA0AAO"&gt;@zalibra&lt;/A&gt;&amp;nbsp;,read that file and load to&amp;nbsp; context and use that context value&amp;nbsp; in the file name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;"/Users/zalibra/Desktop/S3Test/" +context.batchid + "-" + TalendDate.getDate("CCYYMMDD") + "-Exchange.json"&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Feb 2019 05:12:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204469#M5342</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2019-02-28T05:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Append file value to filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204470#M5343</link>
      <description>&lt;P&gt;Came across this on another thead which is why, I think, giving a File Name directly to my Exchange file won't work -- the content of the Exchange file will have data pulled directly from a stock exchange but the filename of the Exchange file will use a value from an already-created file in a folder. So, essentially, I'm joining data from two different sources to create my Exchange file.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;"&lt;EM&gt;Interesting to know that the tOputputFileDelimited gets created at the start of the process. Just put it into two separate queries&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;1. gets the file name and assigns it to the context variable&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;2. gets the content of the file and inserts it into the outputDelimited (calling the context variable which was set in step 1).&lt;/EM&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCqSjCAK" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Archive/resolved-Assigning-value-to-context-and-context-to-filename/td-p/174535&lt;/A&gt;"&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 19:08:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204470#M5343</guid>
      <dc:creator>zalibra</dc:creator>
      <dc:date>2019-02-28T19:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Append file value to filename</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204471#M5344</link>
      <description>&lt;P&gt;Below is what was done to resolve this.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tDBInput --&amp;gt; tFileOutputDelimited (containing the sequence # generated by calling the Postgresql function)&lt;/P&gt; 
&lt;P&gt;tFileInputDelimited --&amp;gt; tJavaRow --&amp;gt; tLogRow (to pick up the ID from the tFileOutputDelimited above to then append to the filename in tFileOutputJSON below)&lt;/P&gt; 
&lt;P&gt;tFileInputJSON --&amp;gt; tFileOutputJSON (tFileOutputJSON gets the raw JSON data from the stock exchange as the content of the file and then uses the sequence # from tFIleInputDelimited to append to the filename)&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;tJavaRow:&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;System.out.println("context = "+ row6);
context.setProperty("sequence", row6.id);&lt;/PRE&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Solved.jpg" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M2us.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140488i103A2BF2EE0096DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M2us.jpg" alt="0683p000009M2us.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2019 17:21:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Append-file-value-to-filename/m-p/2204471#M5344</guid>
      <dc:creator>zalibra</dc:creator>
      <dc:date>2019-03-04T17:21:28Z</dc:date>
    </item>
  </channel>
</rss>

