Skip to main content
Question

Restricting files read from zip


mappymatty
Contributor
Forum|alt.badge.img+3

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

7 replies

erik_jan
Contributor
Forum|alt.badge.img+19
  • 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
Evangelist
  • 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+3
  • Author
  • Contributor
  • August 17, 2016
erik_jan wrote:

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+3
  • Author
  • Contributor
  • August 17, 2016
takashi wrote:

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+3
  • Author
  • Contributor
  • August 18, 2016
takashi wrote:

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+3
  • Author
  • Contributor
  • August 18, 2016
erik_jan wrote:

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+19
  • Contributor
  • August 18, 2016
mappymatty wrote:

Seems to require , instead of ;

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

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