Skip to main content
Question

Where I Put the condition for the FileCopyWriter?


franco69
Contributor
Forum|alt.badge.img+6

I have for example 10 excel files in the sourcefolder that all be read from FME but only 8 files have the right basenames to go through the first tester and the rest of the workflow.......i want at the end move the excel sheets from the source folder in a destiantion folder....all that works already.....but now the filecopywrter move all files from the source folder......how and where i can put a condition that FME should only move the excel files which have the right basenames?

 

Cheers and greetz

Franco

3 replies

j.botterill
Influencer
Forum|alt.badge.img+36
  • Influencer
  • October 4, 2023

How are you reading the excel files? Maybe consider using a FeatureReader with Directory and File Pathnames Reader (safe.com)

Using the path_windows or path_windows_directory and if you use another FeatureReader to read excel, be sure to accumulation - merge intitator and result.path_windowsThen I think you might rename this to filecopy_source_dataset before the File Copy writer


franco69
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • October 4, 2023
j.botterill wrote:

How are you reading the excel files? Maybe consider using a FeatureReader with Directory and File Pathnames Reader (safe.com)

Using the path_windows or path_windows_directory and if you use another FeatureReader to read excel, be sure to accumulation - merge intitator and result.path_windowsThen I think you might rename this to filecopy_source_dataset before the File Copy writer

thx for the answer but i think my description wasnt the best at all.....my colleagues putting excel files into a fixed folder: (source) when workbench is started the reader read the folder and takes all *.xls files ! (normal excel reader)....the format attribute fme_basename i take with..........

then a tester checks if the basename includes "PA7"...........if the file does some transformers will make a split a write some excel files........the last action in the navigator is the filecopywriter which moves ALL excel sheets from the source folder into also a fixed folder (done).....

i want to be sure that the filecopywriter only move the files which had the fme_basename correct.....

 

screenshot_wb


j.botterill
Influencer
Forum|alt.badge.img+36
  • Influencer
  • October 4, 2023
franco69 wrote:

thx for the answer but i think my description wasnt the best at all.....my colleagues putting excel files into a fixed folder: (source) when workbench is started the reader read the folder and takes all *.xls files ! (normal excel reader)....the format attribute fme_basename i take with..........

then a tester checks if the basename includes "PA7"...........if the file does some transformers will make a split a write some excel files........the last action in the navigator is the filecopywriter which moves ALL excel sheets from the source folder into also a fixed folder (done).....

i want to be sure that the filecopywriter only move the files which had the fme_basename correct.....

 

screenshot_wb

perhaps play around with replacing the Reader <all> with the above suggestion of feature reader with Directory and File Path reader format.

 

add another feature reader and do exactly what the Reader <all> was doing. The feature reader has many additional options such as attribute handling = Merge Intitator and Result... this will keep the windows_path attributes. Under Generic you can expose attributesimage


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