Skip to main content
I'm trying to use the Directory and File Pathnames reader. FME 2013 sp3.

 

 

I have the Source Directory parameter set to a directory name, e.g. "C:\\temp"

 

 

I have the Path Filter set to "**/*.xlsx"

 

 

In theory, this should find all xlsx files in the current directory and recurse down through sub-directories.

 

 

2 issues:

 

 

1. if I follow the Reader documentation, I should be able to use "**\\*.xlsx" but it doesn't find any files, so I need to use a forward slash "/" instead of a backslash "\\". (I'm on a Windows system, so you'd think a backslash would be better.)

 

 

2. using the above path filter it successfully recurses into sub-directories and finds xlsx files but it does not find any files in the top level directory.

 

 

Anyone have any idea why it's behaving like this?

 

 

Using the same glob pattern (either forward- or back-slash, doesn't matter) with the Excel Reader works as expected and successfully picks up all xlsx files from the top level directory down.

 

Hi,

 

 

I tested the same condition as yours. The actual behavior of the reader is indeed different from the Reader documentation. And also "**/" is not recursive, it searches just one level sub directories.

 

Maybe there is a bug. I think you'd better contact Safe support.

 

 

As a present workaround, the reader with this setting searches "*.xlsx" files in "C:temp" folder and "C:/temp/**" folders.

 

Source Directory: C:/temp

 

Path Filter: {,**/}*.xlsx

 

 

Takashi
Hi Takashi,

 

thanks very much for your reply, I'll send in a request to Safe support on this.

 

 

Your workaround solution is fantastic! It works with the Dir and File reader and it also works with the traditional Excel reader (I needed a solution that would work with both).

 

 

Thanks!

 

 

Nic
Hi Nic,

 

 

I tried again. Maybe this setting works fine.

 

Source Directory and File Pathnames Directory: C:\\temp\\**

 

Path Filter: *.xlsx

 

 

Takashi

This also works if your files area all the same.

L:\\AppsData\\Houston\\EDS\\EPDATA\\TomTom\\2017_03\\shpa\\mne\\usa/**/**


Reply