Skip to main content
Question

Restricting files read from zip

  • August 17, 2016
  • 7 replies
  • 9 views

mappymatty
Contributor
Forum|alt.badge.img+4

Apologies if this question is a bit newby...I'm only an occasional FME user...

I've downloaded a zip from Ordnance Survey containing .csv files called, for example,

HP40.csv

HP60.csv

HT82.csv

HT84.csv

SE00.csv

SE02.csv

SE04.csv

SD06.csv

SD08.csv

TA00.csv

TA02.csv

I have a CSV reader looking in

C:\\OS_Open_Names\\Latest_Source\\*.zip\\**\\DATA\\*.csv which will read all the .csv files.

Is there a way I can update a single reader to read only the SE, SD and TA files?

Thanks

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • August 17, 2016

Yes, I think you can using this as the Reader source:

C:\\OS_Open_Names\\Latest_Source\\*.zip\\**\\DATA\\S*.csv,C:\\OS_Open_Names\\Latest_Source\\*.zip\\**\\DATA\\T*.csv


takashi
Celebrity
  • August 17, 2016

Hi @matt_yw, this filter expression could also work.

C:\OS_Open_Names\Latest_Source\*.zip\**\DATA\{SE,SD,TA}*.csv

See also here: Directory and File Pathnames Reader Parameters | Special Characters Supported in the Path Filter


mappymatty
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • August 17, 2016

Yes, I think you can using this as the Reader source:

C:\\OS_Open_Names\\Latest_Source\\*.zip\\**\\DATA\\S*.csv,C:\\OS_Open_Names\\Latest_Source\\*.zip\\**\\DATA\\T*.csv

Thanks @erik_jan

 


mappymatty
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • August 17, 2016

Hi @matt_yw, this filter expression could also work.

C:\OS_Open_Names\Latest_Source\*.zip\**\DATA\{SE,SD,TA}*.csv

See also here: Directory and File Pathnames Reader Parameters | Special Characters Supported in the Path Filter

 

Thanks @takashi for the answer and the link to the documentation.

mappymatty
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • August 18, 2016

Hi @matt_yw, this filter expression could also work.

C:\OS_Open_Names\Latest_Source\*.zip\**\DATA\{SE,SD,TA}*.csv

See also here: Directory and File Pathnames Reader Parameters | Special Characters Supported in the Path Filter

I couldn't get this approach to work in the end - it only seems to work if it's folder names within the {}. For files I think I need to use the approach @erik_jan  proposed.

mappymatty
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • August 18, 2016

Yes, I think you can using this as the Reader source:

C:\\OS_Open_Names\\Latest_Source\\*.zip\\**\\DATA\\S*.csv,C:\\OS_Open_Names\\Latest_Source\\*.zip\\**\\DATA\\T*.csv

Seems to require , instead of ;


erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • August 18, 2016

Seems to require , instead of ;

Sorry, you are right. I will change this in the answer.