Skip to main content
Question

Setting a dynamic Destination Fanout Directory


smithgk
Contributor
Forum|alt.badge.img+8

Hi all,

 

I have a dataset that contains a _dirpath attribute that I would like to use as the Destination Fanout Directory. My workflow injests CSVs from multiple different folders, and I would like to output the Writer data to the same folder that the data originally came from. Does anyone know if that is possible? I can't seem to set an attribute as an input for the Destination Fanout Directory. Any suggestions?

2 replies

joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • January 19, 2024

If you use a FeatureWriter you can set your _dirpath attribute as Dataset and maybe create a _filename attribute to use as CSV File Name (Im guessing you are writing to CSV). The _filename.csv file will be written in the _dirpath directory.

imageYou might have to play around with the other parameters of the FeatureWriter to get it to correctly append/insert/truncate your data.


smithgk
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • January 19, 2024
joepk wrote:

If you use a FeatureWriter you can set your _dirpath attribute as Dataset and maybe create a _filename attribute to use as CSV File Name (Im guessing you are writing to CSV). The _filename.csv file will be written in the _dirpath directory.

imageYou might have to play around with the other parameters of the FeatureWriter to get it to correctly append/insert/truncate your data.

Hi there, thanks for this tip! This got me going in the correct direction. I did a little attribute work up front to create a full path name [basically: @Value(_dirpath)@Value(_rootname)_checkResults_@DateTimeFormat(@DateTimeNow(), %Y%m%d_%I%M%p).xlsx] then set that attribute as the Dataset, and was on my way. everything was posted exactly as it should in the location I spelled out. Thanks so much!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings