Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
phiibuntu
Contributor
Contributor

tfilecopy missunderstanding

Hello,

I 'm making a job to copy and rename files. My tfilecopy seems to copy and correctly rename the files.

Sadly files are created with good name but they're empty.

Files are 0 ko in good destination repertory...

here's a screenshot of the job : no error ... I don't understand what I have missed.

0683p000009M1kh.png

Labels (2)
23 Replies
phiibuntu
Contributor
Contributor
Author

File copy don't, delete original file, for testing I don't think it was important, I only need copy and rename file not yet delete

Anonymous
Not applicable

Hi,

 

     Please give full file path instead of file name from tFileList

 

((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

    This will help to get the source file properly.

 

      If you are picking the file name from lookup flow only, then you will have to store the directory path also there.

 

Warm Regards,
Nikhil Thampi

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

phiibuntu
Contributor
Contributor
Author

if I put 

 

"/home/phii/Documents/renommer" instead 

((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) 

no files match in Tmap (like Talend doesn't find file name from source repertory). so nothing happens in TFilecopy 

Anonymous
Not applicable

Hi,

 

    Why don't you give like below in your tfilecopy

 

"/home/phii/Documents/renommer/"+ok4.document_name 

I am assuming that your source directory is constant. If it is different, then you will have to pass the full file path also as part of tFlowtoIterate as additional column and assign below value.

 

((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

 

 

Warm Regards,
Nikhil Thampi

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

 

 

phiibuntu
Contributor
Contributor
Author

Sorry perhaps I don't have enough skill 

 

If I use : 

"/home/phii/Documents/renommer/"+ok4.document_name 

I have this message : 

 

The source File "/home/phii/Documents/renommer/AS_Metro_STRAS_FL_2017_10_23.pdf" does not exist or is not a file.

 

because in source repertory the file don't have the same name (I want to rename it with tmap inner join). 

 

vapukov
Master II
Master II

you are swap source and target - this is why several time you was asked to attach screenshot of component, as suggested by @nthampi

 

source file - 

((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

target folder - 

"/home/phii/Documents/renommer/"

 target name:

ok4.document_name 

 

0683p000009M1lG.png

 

Anonymous
Not applicable

Hi,

 

     Don't worry. Lets go back to basics. Please try the below instructions.

 

 

0683p000009M1lL.png

 

Warm Regards,
Nikhil Thampi

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

 

 

 

phiibuntu
Contributor
Contributor
Author

I finally find solution with your help.

 

here's where I make mistake : I have to rename here the screenshot if someone have same lake of experience about Talend like me 0683p000009MACn.png

 

0683p000009M1eu.png

Thank you for your help, I learn a lot about file management in Talend! )

phiibuntu
Contributor
Contributor
Author

step by step...

Job works but files are limited to 20,1ko and are unreadable 

file and name are ok but files content are corrupted...

 

If you have an Idea...

phiibuntu
Contributor
Contributor
Author

I pull the files via ascii. Switched it to binary to fix the corrupted files.

 

ok it seems to work fine now 0683p000009MACn.png