tfilecopy missunderstanding

Five Stars

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.

Capture d’écran de 2018-12-17 11-42-17.png


Accepted Solutions
Highlighted
Employee

Re: tfilecopy missunderstanding

Hi,

 

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

 

 

image.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 :-)

 

 

 


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)

All Replies
Employee

Re: tfilecopy missunderstanding

Hi,

 

   Could you please provide the component screen shot and the business user case so that we will get more idea about the task?

 

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 :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Thirteen Stars

Re: tfilecopy missunderstanding

hi,

 

you need to provide more information - what in tMap? what settings for tFileCopy and etc

-----------
Eight Stars

Re: tfilecopy missunderstanding

hi @phiibuntu,

Greetings of the day,

i would like to repeat the same as @nikhilthampi mentioned, once you specify or attach a component view of Tfilecopy then the Community will able to guide you from misunderstanding to proper understanding.

Well humor apart!!..Pls check the settings of the component whether you have given the correct source path(from where you must copy the file) and correct destination path(from where you are going to paste the file),

and if you want to rename the file then by specifying the name enclosed in double quotes.

Pls attach the screenshot of tfilecopy.

Thanks

Ankit

Five Stars

Re: tfilecopy missunderstanding

the tFilecopy component screenshot : 

 

Capture d’écran de 2018-12-17 13-04-50.png

 

the Tmap screenshot :

Capture d’écran de 2018-12-17 13-06-14.png

 

As you see the document_name come from inner join (mysql) 

I need to copy file and change ID to document name in another repertory. 

I hope I give you enough details. 

My proble is that the document is not really copy with tfilecopy, only document name works with inner join from source file name to destination file name.

 

Five Stars

Re: tfilecopy missunderstanding

and the TIteratetoflow screenshot in case...

Capture d’écran de 2018-12-17 13-09-15.png

Employee

Re: tfilecopy missunderstanding

Hi,

 

    Could you please check whether you are giving the full path for the source to do copy? I believe you are populating only document name.

 

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 :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Thirteen Stars

Re: tfilecopy missunderstanding


@phiibuntu wrote:

 

 

 

I hope I give you enough details. 

 


of course - not :-)

ok, we could guess - if join work - newColumns contain proper value (hope), but what about tFileCopy? is tFileCopy delete original file?

-----------
Employee

Re: tfilecopy missunderstanding

Hi,

 

   Could you please select the check box for Fail on error?

 

    Then it will show that your source path is not correct.

 

 

image.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 :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Five Stars

Re: tfilecopy missunderstanding

I think it is what I'm doing wrong.

 

in Tfilelist I give the full path for source file, but I don't know how can I do in Tmap to manage files.

I think tmpa I made only give document_name (file name) to Tfilcopy. 
I hope I m clear with my bad english...

 

When I select the check box for Fail on error nothing more happens

Five Stars

Re: tfilecopy missunderstanding

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

Employee

Re: tfilecopy missunderstanding

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 :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Five Stars

Re: tfilecopy missunderstanding

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 

Employee

Re: tfilecopy missunderstanding

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 :-)

 

 


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Five Stars

Re: tfilecopy missunderstanding

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). 

 

Thirteen Stars

Re: tfilecopy missunderstanding

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

 

source file - 

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

target folder - 

"/home/phii/Documents/renommer/"

 target name:

ok4.document_name 

 

Screen Shot 2018-12-18 at 2.28.26 AM.png

 

-----------
Highlighted
Employee

Re: tfilecopy missunderstanding

Hi,

 

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

 

 

image.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 :-)

 

 

 


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Five Stars

Re: tfilecopy missunderstanding

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 Smiley Happy

 

Capture d’écran de 2018-12-17 14-32-48.png

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

Five Stars

Re: tfilecopy missunderstanding

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...

Five Stars

Re: tfilecopy missunderstanding

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

 

ok it seems to work fine now Smiley Happy

Five Stars

Re: tfilecopy missunderstanding


I thought it was solved but in fact the job rename good the filename from mysql database.

But it's only copy the first file it found. 

So every file renamed have the same siez, and are in fact the same file with the different name.

I try a lot of thing about this simple job I really don't understand why it copy only one file and rename it (19 time in the screenshot below).

 

Capture d’écran de 2018-12-26 13-16-07.png

 

here the resulte (with all goo named files with the same size (beacause they're the same file with different name) :

 

Capture d’écran de 2018-12-26 13-15-57.png

I'm a little bit disappointed, I thought it was a really simple job to do...

Thanks for your help.

Employee

Re: tfilecopy missunderstanding

Hi,

 

    I think you are not passing the right value to the source file path.

 

    I would suggest you to print and see the different variables you are passing in the flow for file copy.

 

    Somewhere the data is getting overwritten with same value. The easiest way to identify the area will be to print the value at each stage.

 

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 :-)

 


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)
Five Stars

Re: tfilecopy missunderstanding

I try every tfilelist variables values and nothing works 

 

With the same value for source path ( ((String) globalMap.get("tFileList_1_CURRENT_FILEPATH")) in simple job with :  tfilelist  ===> tfilecopy the files are correctly copied

if I make this one : tfilelist ===> titeratetoflow ===> tfilecopy : only one file is copied

 

with the same source path value ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

 

other value doesn't work. 

Five Stars

Re: tfilecopy missunderstanding

if I use this source path value : ((String)globalMap.get("tFileList_1_CURRENT_FILE"))

 

tfilecopy give some errors : Exception in component tFileCopy_1 (always_copy)
java.lang.RuntimeException: The source File "dbb16aa9-b792-6e2b-01c2-5aa93889b70b" does not exist or is not a file.

 

and don't find any files.

 

this value seem to be the only who works : ((String) globalMap.get("tFileList_1_CURRENT_FILEPATH"))  but only for one file.

with my simple test I think titeratetoflow seems to have an issue in my job. 

 

 

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.