I want to copy files based on workspace result values.
Example: a, b, c builders are applied for tenders of xyz road construction. All 3 companies tenders are integrated into one document and named as xyz road (its same as fme workspace result road names)
so when fme workspace result record contains xyz road, then pickup "xyz road" excel/pdf tender files and copy them into a specified folder path (or create new folder and copy files).
Any guidance on how to check the result road names with external files present in a directory (Lookup tables?)? is it possible in an easy way to automate it ? How can i compare result and copy respective files into a specified folder. Any guidance is helpful.
Thanks,
khk
Best answer by khk
Hi,
Done as below. I was thinking of creating variable for result features storage and
reading pdf files to copy based on result names. But no need of variable creation with
help of lookup table. Copy file is done with python caller.
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
The "Directory and File Pathnames"-Reader and the "PythonCaller"- or "SystemCaller"-Transformers could be helpfull. You can also use the Workspace Parameter "Shutdown Python Script" to do some afterwork.
Thanks for throwing some light. I didn't find "Directory and File Pathnames"- Reader, in which category it is present.?
It is not a transformer located in a category but a type of reader you can insert in your workspace.
I also would go with a PythonCaller, get the value of the attribute, create a URL for the files to copy and use the os.path.copy() method to copy the correct files.
I would go with the "File Copy"Writer. That writer will take arguments for source files and destination folder and filename. The attributes can be derived from attributes from a file (in your case the abc and xyz examples).
I personally think the file copy writer as erik_jan pointed out would be a lot simpler.
You could use an attribute creator with conditional value set to each 'xyzroad' to grab the external files for and then set that as the filecopy_source_dataset value. If you have multiple different values then you could concatenate the basename (assuming the roads share the same name as your external files) of the road dataset with the path name and .xls (or what ever your external files are) and then set that attribute as the filecopy_source_dataset.
Hi,
Done as below. I was thinking of creating variable for result features storage and
reading pdf files to copy based on result names. But no need of variable creation with
help of lookup table. Copy file is done with python caller.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.