I have a workspace that copies a file from one location to another. Now I want to use the copied file as input to a reader. How do I do that?
I have a workspace that copies a file from one location to another. Now I want to use the copied file as input to a reader. How do I do that?
Use the FeatureWriter set to File Copy instead of "classic" writer.
It will output attributes for source and destination datasets, as well as the destination filename.
Use the FeatureWriter set to File Copy instead of "classic" writer.
It will output attributes for source and destination datasets, as well as the destination filename.
Umm. I don't see these output attributes. Where are they located?
Use AttributeExposer and enter them manually
Thanks @caracadrian. What I figured out from your pointers:
For a complete working process chain one needs:
Creator >> FeatureWriter set to `filecopy` >> AttributeExposer with manually entered values of `filecopy_source_dataset, filecopy_dest_dataset, filecopy_filename` >> fed to StringConcatenator in order to build the full path name to >> feed to FeatureReader.
Don't forget to enable Output Ports on the FeatureWriter, it defaults to None. Otherwise you'll only be able to read the Summary in AttributeExposer.
Caveat:
In filecopy you must define `filecopy_dest_dataset`. It's tempting to use `_dataset` from Summary instead, which is taken from the writer's "dataset" parameter, but the later StringConcatenator won't use it as expected. (Instead of a single combined path output it will yield 2 output rows. One for the connector path of Attribute Exposer and one from the Summary connector.)
In StringConcatenator it's up to you to ensure the combined path string is valid (there doesn't seem to be an equivalent to Python's os.path.join() which validates the path segments and connectors to ensure no invalid characters).
This took a couple hours to sort out. I guess folks must usually resort to doing this kind of thing directly in sub process command shell or python script as it's pretty fiddly doing this in workbench.