Skip to main content
Solved

read multiple files from a folder that all contain a specific text string in the title

  • October 18, 2021
  • 4 replies
  • 250 views

I am trying to read in multiple files from a folder at once which contain a specific text string in the title and not any files that don't contain that string. I want it to be dynamic, such that if the files in the folder change, the reader will update as I want to put this at the start of a workflow which will put all the features from each individual source file into a single file and perform some transformations with that data. I have managed to figure out making a reader that looks at a folder and all its sub folders, but it reads in all the files in the folder, some of which I don't need/want. Is there a way I can apply a search filter to the reader so it only brings in files that have certain terms in the title?

Best answer by ebygomm

ocarey wrote:

Sorry for my ignorance I've only just started using FME. How would I know which reader I am using? I am just using the "add reader" function in the workbench. I am using Mapinfo Tab as the format and the dataset is a folder on my server which I am selecting using the "select multiple folders/files" option and I am including all sub folders as the files are split up into sub folders. I'm using "single Merged Feature type" for the workflow option.

No problem, if you are reading mapinfo files you are using a mapinfo reader. If you have added it and chosen a folder it should have created a published parameter called something like SourceDataset_MAPINFO

This will look something like 

C:\folders\myfolder\*.tab

If you want it for example to only read tab files that contain the word test you could amend to

C:\folders\myfolder\*test*.tab

 

 

View original
Did this help you find an answer to your question?

4 replies

ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • October 18, 2021

What reader are you using? You can use wildcards in the path to only include files that contain certain terms


  • Author
  • October 18, 2021

Sorry for my ignorance I've only just started using FME. How would I know which reader I am using? I am just using the "add reader" function in the workbench. I am using Mapinfo Tab as the format and the dataset is a folder on my server which I am selecting using the "select multiple folders/files" option and I am including all sub folders as the files are split up into sub folders. I'm using "single Merged Feature type" for the workflow option.


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • Best Answer
  • October 18, 2021
ocarey wrote:

Sorry for my ignorance I've only just started using FME. How would I know which reader I am using? I am just using the "add reader" function in the workbench. I am using Mapinfo Tab as the format and the dataset is a folder on my server which I am selecting using the "select multiple folders/files" option and I am including all sub folders as the files are split up into sub folders. I'm using "single Merged Feature type" for the workflow option.

No problem, if you are reading mapinfo files you are using a mapinfo reader. If you have added it and chosen a folder it should have created a published parameter called something like SourceDataset_MAPINFO

This will look something like 

C:\folders\myfolder\*.tab

If you want it for example to only read tab files that contain the word test you could amend to

C:\folders\myfolder\*test*.tab

 

 


  • Author
  • October 19, 2021
ebygomm wrote:

No problem, if you are reading mapinfo files you are using a mapinfo reader. If you have added it and chosen a folder it should have created a published parameter called something like SourceDataset_MAPINFO

This will look something like 

C:\folders\myfolder\*.tab

If you want it for example to only read tab files that contain the word test you could amend to

C:\folders\myfolder\*test*.tab

 

 

Thanks this has done the trick. Just for reference, since I am also using sub folders the path ended up looking like:

 

 C:\folders\myfolder\**\*test*.tab

 


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