Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
RA6
Creator
Creator

File Moving and Renaming

Hello,

 

I have multiple files on my main folder and i have to look for two files in it.

file1_140618.csv

file2_140618.csv

 

Please note that the date in these files keep changing.

 

What i actually do:

When i check the 1st file, it has to log the information (file_properties) in a file before moving and renaming it to another folder.

The same thing applies to the second file lookup; same step.

 

At this moment, I am not able to use one filelist because the tfilecopy does not have the regular expression option. And also i will not know which file is being taken into consideration while using ((String)globalMap.get("tFileExist_1_FILENAME")) in the tfilecopy.

 

0683p000009Lxz9.jpg

 

0683p000009LyLT.jpg

 

Can you suggest how i can optimize this job Or is there a better way to do this?

 

Thank you.

 

Best regards,

asadasing

 

 

 

0683p000009Ly9p.jpg

 

 

Is there a way to optimize this job; i meaan

 

Labels (2)
6 Replies
TRF
Champion II
Champion II

A single subjob with tFileList-->tFileProperties-->tFileOutputDelimited-->tFileCopy should be enough.

You should use "tFileList_1_CURRENT_FILEPATH" instead of "tFileExist_1_FILENAME" in tFileCopy (or I miss something).

fdenis
Master
Master

you can use:

only one tFileList

file path is globalMap.get("tFileList_1_CURRENT_FILEPATH")

tfileexist is not mandatory

onSubjobOk is Better after iterate.

 

Regards

RA6
Creator
Creator
Author

Thank you for your quick reply.

 

Lets assume i have to rename the files mentioned as follows:

 

file1_140618 => client1234abc

file2_140618 => client987xyz 

 

Then what should i put in my tfilecopy >> destination filename?

TRF
Champion II
Champion II

Where does the target filename come from?

RA6
Creator
Creator
Author

Normally,

 

i will have only two files:

 

Client_xxxxx

Address_xxxxx

 

And my target name should be:

 

Client_xxxxx => customers_1806181540 (currentDateTime)

Address_xxxxx => Address_1806181540 (currentDateTime)

 

As at now, i am hard coding both files in the talend interface.

 

0683p000009Ly8Q.jpg


Capture3.JPG
fdenis
Master
Master

if you want the best way to do this, it's the best way.
when you open talend you can directly speak about 2 file who are going to be copied.

Optimizing ?
- Speed
- Globalisation (do the same for all incoming files)
- Alerting (if one file is not present)
what is the next step
you are the only one who can say "it's the best way!"