Question

Restricting files read from zip

  • 17 August 2016
  • 7 replies
  • 3 views

Badge

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

Userlevel 2
Badge +16

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

Userlevel 2
Badge +17

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

Badge

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

 

Badge

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.
Badge

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.
Badge

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 ;

Userlevel 2
Badge +16

Seems to require , instead of ;

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

Reply