Using the tSystem component to unzip a file to the same folder using powershell

Seven Stars

Using the tSystem component to unzip a file to the same folder using powershell

Hello,

 

Had a few questions about using the tsystem component

Do I need to setup a Environment Variable in my -PATH system variable for my powershell path?

I do not get any Java Errors with my current syntax in my tSystem component, but it's not actually not unzipping the file and the job ends as soon as the tSystem component is activated

"cmd /c start powershell -noninteractive expand-archive -Path '//networkc/Documents/File.Zip' -destinationPath '//networkc/Documents/'"

This command works in powershell but not in the tSystem component.

Look at my attachments for my component sequence and Component Basic settings for tSystem Component.

Do you see anything that is wrong with my current Talend Job? I do use context variables in my tFileList component that call on the same folder paths as the powershell folder paths. 

How do you call on Talend context variables in the actual powershell command? Is it same as adding one to a filepath just adding + symbols (+ context.filepath +)?

 

 

Help would be greatly appreciated first time using a tSystem component in Talend,

 

Seven Stars

Re: Using the tSystem component to unzip a file to the same folder using powershell

Using tFileUnarchive might be a better option to call an external unzip command.

Highlighted
Seven Stars

Re: Using the tSystem component to unzip a file to the same folder using powershell

I made a post about the error I was getting when I tried to execute a job with a tfileunarchive component.  I have to look for alternative ways to unzip a file in Talend because tfileunarchive is unusable, until I fix the error I'm getting below. 

 

I am getting this error in my Java Code for my tfileunarchive component. I am currently running Talend Open Studio Data Integration 7.1.

It has something to do with my JAR plugin I installed with this component on my RDC. I am able to run the same job on my local machine with no issues. A few questions how can you reinstall the plugin for this component. What site has these plugins available? How would you delete the old plugin for this component? I need to make sure I am adding these plugins to the right folder as well, what folder do you install these plugins to?

 

if (tmpFileURL_tFileUnarchive_2.endsWith(".tar.gz")
|| tmpFileURL_tFileUnarchive_2.endsWith(".tgz")) {
org.apache.tools.tar.TarInputStream zip_tFileUnarchive_2 = null;
java.io.InputStream inputStream_tFileUnarchive_2 = null;
try {
inputStream_tFileUnarchive_2 = new java.io.FileInputStream(
zipFileURL_tFileUnarchive_2);
inputStream_tFileUnarchive_2 = new java.util.zip.GZIPInputStream(
inputStream_tFileUnarchive_2);
zip_tFileUnarchive_2 = new org.apache.tools.tar.TarInputStream(
inputStream_tFileUnarchive_2);

org.apache.tools.tar.TarEntry entry_tFileUnarchive_2 = null;
java.io.InputStream is_tFileUnarchive_2 = null;
while ((entry_tFileUnarchive_2 = zip_tFileUnarchive_2
.getNextEntry()) != null) {
boolean isDirectory_tFileUnarchive_2 = entry_tFileUnarchive_2
.isDirectory();
if (!isDirectory_tFileUnarchive_2) {
is_tFileUnarchive_2 = zip_tFileUnarchive_2;
}

Any help would be greatly appreciated!

 

Thanks,

 

Andrew

Employee

Re: Using the tSystem component to unzip a file to the same folder using powershell

Hi,

 

    Ideally the tfileunarchive component should be able to automatically install all the jars provided you do not have any firewall issues.

 

   But if you have to install jars manually, could you please refer the below link?

 

https://help.talend.com/reader/JoDPA5CxpUcrjx1PF6gUgQ/uam2vfCM9YpknRB7IKBVcA

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

Seven Stars

Re: Using the tSystem component to unzip a file to the same folder using powershell

Hey Nikhilthampi,

 

Thanks for your response,

 

Can you answer a few questions for me regarding this issue?

Would having two different versions of Talend Data Integrations Open Studio, installed on your Azure box cause issues with the external jar modules (packages) that are being used in the newer edition of Talend 6.5 ---> to 7.1. Also if you have Additional Third Party libraries (2070) packages for me on my VPN, but you cannot install them( doesn't bring you to the next screen when you click Finish to read/accept all terms and conditions and then install them). Can you assume that there is a underlying Proxy setup on your box that won't allow you to connect to Talend Exchange site?

 

http://talend-update.talend.comand?

 

 

Employee

Re: Using the tSystem component to unzip a file to the same folder using powershell

Hi,

 

    I have multiple versions of Talend installed in my laptop and its working fine without any issues. But I would advise against direct import/export of jobs from one version to another as it may lead to issues since there are major changes in version 7 compared to previous version.

 

   I didn't understand your second query fully. Are you asking whether VPN will create any issues to access Talend exchange? The answer is yes unless it is white-listed.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

 

Seven Stars

Re: Using the tSystem component to unzip a file to the same folder using powershell

Hello Nikhilthampi,

 

The import/export I did with my job to import it to my Azure box was between the same versions of Talend. I'm just thinking that there is a proxy blocking the components

 

Can you make sure I have my white list setup correctly inside of my Talend Preferences --> Network Connections? 

 

Please refer to the screenshot I attach of my current proxy white list.

 

Also how do you get the external module that you installed on the Exchange site https://talend-update.talend.com/ to show up in your Module View in Talend.

 

Notice I have to use the tLibraryLoad to load the external module for the tfileuarchive component to work properly. The module that I am using isn't in my Module list. What file path does the jar file have to be pointed to for it to load in the Module view properly?

 

 

 

 

 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog