<?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: tFileArchive - Zip each file in directory into separate .zip files? in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tFileArchive-Zip-each-file-in-directory-into-separate-zip-files/m-p/2197330#M1118</link>
    <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hi,&lt;BR /&gt;Un-check the "All Files" option in tFileArchive component. Once this is done, use the current file from the tFileList as the "Filemask" for the tFileArchive component.&lt;BR /&gt;Archive file:&lt;BR /&gt;&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).replaceAll("\\.txt$", "") + ".zip"&lt;/PRE&gt;&lt;BR /&gt;replaceAll is used to remove the file extension, which in this case is ".txt" so that the archive files are created as "text1.zip" and not "text1.txt.zip".&lt;BR /&gt;Filemask:&lt;BR /&gt;&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILE"))&lt;/PRE&gt;&lt;BR /&gt;This will ensure that the tFileArchive is archiving only the current file.&lt;BR /&gt;Attaching screen shots.&lt;BR /&gt;Regards,&lt;BR /&gt;Abhi&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Archive file (you could prefer this for case sensitive problems):
&lt;BR /&gt;
&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).substring(0,((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).length()-4).replaceAll("\\.TXT", "") + ".zip"&lt;/PRE&gt;</description>
    <pubDate>Fri, 13 May 2011 17:33:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-05-13T17:33:51Z</dc:date>
    <item>
      <title>tFileArchive - Zip each file in directory into separate .zip files?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileArchive-Zip-each-file-in-directory-into-separate-zip-files/m-p/2197328#M1116</link>
      <description>I have a job that looks like: 
&lt;B&gt;tFileList &amp;gt; tFileArchive&lt;/B&gt; which puts the files from a directory into a .zip if I check the ?All Files? option on the tFileArchive component. 
&lt;BR /&gt;
&lt;B&gt;Is there a way to zip each file into a separate .zip file? &lt;/B&gt;
&lt;BR /&gt;For example if my folder C:/Talend/ there are the files 
&lt;B&gt;text1.txt, text2.txt, and text3.txt&lt;/B&gt;. I would like the job to make: 
&lt;BR /&gt;C:/Talend/text1.zip
&lt;BR /&gt;C:/Talend/text2.zip
&lt;BR /&gt;C:/Talend/text3.zip
&lt;BR /&gt;To dynamically get all the file names I do the following:
&lt;BR /&gt;In the file name field, press ctrl+blank space, then select the global variable: tFileList_current_file_path</description>
      <pubDate>Sat, 16 Nov 2024 13:09:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileArchive-Zip-each-file-in-directory-into-separate-zip-files/m-p/2197328#M1116</guid>
      <dc:creator>talendtester</dc:creator>
      <dc:date>2024-11-16T13:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: tFileArchive - Zip each file in directory into separate .zip files?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileArchive-Zip-each-file-in-directory-into-separate-zip-files/m-p/2197329#M1117</link>
      <description>Hi,
&lt;BR /&gt;Un-check the "All Files" option in tFileArchive component. Once this is done, use the current file from the tFileList as the "Filemask" for the tFileArchive component.
&lt;BR /&gt;Archive file:
&lt;BR /&gt;
&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).replaceAll("\\.txt$", "") + ".zip"&lt;/PRE&gt;
&lt;BR /&gt;replaceAll is used to remove the file extension, which in this case is ".txt" so that the archive files are created as "text1.zip" and not "text1.txt.zip".
&lt;BR /&gt;Filemask:
&lt;BR /&gt;
&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILE"))&lt;/PRE&gt;
&lt;BR /&gt;This will ensure that the tFileArchive is archiving only the current file.
&lt;BR /&gt;Attaching screen shots.
&lt;BR /&gt;Regards,
&lt;BR /&gt;Abhi</description>
      <pubDate>Sun, 02 Jan 2011 16:34:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileArchive-Zip-each-file-in-directory-into-separate-zip-files/m-p/2197329#M1117</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-02T16:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: tFileArchive - Zip each file in directory into separate .zip files?</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tFileArchive-Zip-each-file-in-directory-into-separate-zip-files/m-p/2197330#M1118</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hi,&lt;BR /&gt;Un-check the "All Files" option in tFileArchive component. Once this is done, use the current file from the tFileList as the "Filemask" for the tFileArchive component.&lt;BR /&gt;Archive file:&lt;BR /&gt;&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).replaceAll("\\.txt$", "") + ".zip"&lt;/PRE&gt;&lt;BR /&gt;replaceAll is used to remove the file extension, which in this case is ".txt" so that the archive files are created as "text1.zip" and not "text1.txt.zip".&lt;BR /&gt;Filemask:&lt;BR /&gt;&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILE"))&lt;/PRE&gt;&lt;BR /&gt;This will ensure that the tFileArchive is archiving only the current file.&lt;BR /&gt;Attaching screen shots.&lt;BR /&gt;Regards,&lt;BR /&gt;Abhi&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Archive file (you could prefer this for case sensitive problems):
&lt;BR /&gt;
&lt;PRE&gt;((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).substring(0,((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).length()-4).replaceAll("\\.TXT", "") + ".zip"&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 May 2011 17:33:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tFileArchive-Zip-each-file-in-directory-into-separate-zip-files/m-p/2197330#M1118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-13T17:33:51Z</dc:date>
    </item>
  </channel>
</rss>

