Skip to main content

I have about a hundred or so .csv files. They all live in different folders on the same network. In a database table I have the path and name of each file (something like: "M:\\ExampleFolder\\Example.csv"). As I process each record, I just want to copy each source .csv file to a folder called "D:\\Temp" and rename it "Final.csv". So "M:\\ExampleFolder\\Example.csv" would get copied to "D:\\Temp\\Final.csv" when that record was processed. The next record in the table might be "D:\\ATotallyDifferentFolder\\Different.csv". When that record gets processed I want that file to replace/become the new "D:\\Temp\\Final.csv". I can't seem to figure out how to use the File Copy writer to do this. Any help would be appreciated. Thank you.

You can use the specific parameters for this writer to do that:

  • filecopy_source_dataset
    • This is the source path
  • filecopy_dest_filename
    • This is the new name, in your case "Final.csv"

Set Dataset to C:\\ and Subfolder name to Temp and you are good to go.

 

Also see the documentation. This is one of the not so intuitive writers in my opinion.

 

As an alternative you can use a SystemCaller with dos commandline like copy and xcopy.


You can use the specific parameters for this writer to do that:

  • filecopy_source_dataset
    • This is the source path
  • filecopy_dest_filename
    • This is the new name, in your case "Final.csv"

Set Dataset to C:\\ and Subfolder name to Temp and you are good to go.

 

Also see the documentation. This is one of the not so intuitive writers in my opinion.

 

As an alternative you can use a SystemCaller with dos commandline like copy and xcopy.

Thank you very much for your help and quick response and I'm sorry to be such a newbee, but I don't know exactly where I should enter these values in the writer.... If I start from the "Add Writer" dialog below, how do I set "filecopy_source_dataset" and "filecopy_dest_filename"? For example is "Dataset" "filecopy_dest_filename"? Where to I enter my dynamic attribute value with the source path and filename?image.png Thank you again?


I would still love to know how the file copy writer works (will probably need this down the road for sure), but I tried SystemCaller and got that to work in about 30 seconds. Thank you so much!.... my initial plan "B" was going to be PythonCaller, but since all my data is in Windows a quick dos copy command does the trick.


Reply