Skip to main content
Question

Directory and File Pathnames reader problems

  • October 24, 2013
  • 4 replies
  • 40 views

nic_ran
Contributor
Forum|alt.badge.img+16
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.

 

4 replies

takashi
Influencer
  • October 25, 2013
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

nic_ran
Contributor
Forum|alt.badge.img+16
  • Author
  • Contributor
  • October 25, 2013
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

takashi
Influencer
  • October 30, 2013
Hi Nic,

 

 

I tried again. Maybe this setting works fine.

 

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

 

Path Filter: *.xlsx

 

 

Takashi

dbklingdom
Contributor
Forum|alt.badge.img+7
  • Contributor
  • October 19, 2017

This also works if your files area all the same.

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


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