Skip to main content
Question

How to import only selected files from a list in a folder?


Hi !

I have a folder containing about 20000 jpeg files and separately a list in csv format containing names of some jpeg files which I'll need. How can I import in FME only the jpeg files from the list and not all images in the folder ?

Thank you.

 

 

6 replies

jkr_wrk
Influencer
Forum|alt.badge.img+29
  • July 19, 2021

Use a FeatureMerger

 

If you do a Directory and File Pathnames Reader on the folder containing jpeg files and then merge the data with the CSV only the items you need will come out of the Merged output port.

 


  • Author
  • July 19, 2021
jkr_da wrote:

Use a FeatureMerger

 

If you do a Directory and File Pathnames Reader on the folder containing jpeg files and then merge the data with the CSV only the items you need will come out of the Merged output port.

 

No, I don't want to import more than 20 000 photos to do the feature merge. I need to import in my workbench only from my list.

Thanks.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 19, 2021

Read the csv file. Sent the features to a FeatureReader where the Format is jpeg and the Dataset is the attribute containing the full path to the file. You may need to create this attribute beforehand from a combination of published parameters and attributes if the csv only has the file names and not the full path.


jkr_wrk
Influencer
Forum|alt.badge.img+29
  • July 20, 2021
sam.27 wrote:

No, I don't want to import more than 20 000 photos to do the feature merge. I need to import in my workbench only from my list.

Thanks.

The Directory and File Pathnames Reader does not import 20 000 photos. It only reads the file location properties of 20 000 photos.

 

But the solution of jdh is much better. Read the csv and then read the photos based on the filename in the csv. Much quicker indeed.


  • Author
  • July 20, 2021

Do you know if we can do this with a Python script in the file reader ?

 

Thanks.


jkr_wrk
Influencer
Forum|alt.badge.img+29
  • July 20, 2021
sam.27 wrote:

Do you know if we can do this with a Python script in the file reader ?

 

Thanks.

I guess you could. But I don't know you should.

What you want to do is pretty basic FME and Python is almost never needed when using FME. I think the solution is already mentioned by jdh. If not, maybe look at some other answers on the forum or rephrase the question.


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