Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Trouble with BLANKs

Hi,

I have an app with a subroutine where I check the files in a given directory.

I do this in a FOR EACH loop with a filemask. The filemask looks like

>> '[name]*.[ending] <<

where the ending can be either pdf or xls - that is one of the parameters that I pass to the subroutine.

The code works fine with four ´reports where the filename does not contain any blanks. E.g.

- Gesamt_Fahrer.pdf

- 64_Fahrer.pdf

- 74_Fahrer.pdf

- Übersicht_Kollis.xls

I run into problems in the iteration where I am looking at the name of a report that contains a timestamp. It looks like

>> Thingy_Report - 15 04 29 - 06 30 <<

Here, my code does not seem to load anything at all.

I have no filter whatsoever in the LOAD itself, so the error can actually only be that the files do not match the filemask.

Strangely, though, in the Debugger, every single file of that type in that directory is parsed, but every time it reads "0 records fetched".

Can anyone help me there?

Thanks a lot!

Best regards,

DataNibbler

1 Solution

Accepted Solutions
marcus_sommer

Yes I think so then would the filelist those file grab then the load must be successful or create an error but not doing nothing.

- Marcus

View solution in original post

5 Replies
marcus_sommer

Hi DataNibbler,

path's and filenames with blanks or special chars needs to be normally wrapped with double-quotes or something similar like square-brackets, maybe so: filelist('[' path & '\*' & ext & ']').

- Marcus

datanibbler
Champion
Champion
Author

Hi Marcus,

Ah, I need to use those in the filelist? I'll try.

datanibbler
Champion
Champion
Author

Hmm ... there seems to be some error still:

The command to assemble my filemask now looks like this:

>>  LET v_filemask = chr(91) & '$(p4)' & '*' & chr(93) & '.' & '$(p2)'; <<

(where p4 is a target_filename (that is without timestamp, thus without blanks, but the * should include those, no? And p2 is an ending (either pdf or xls)

Now none of the files matches my filemask and the LOAD is completely skipped.

marcus_sommer

Yes I think so then would the filelist those file grab then the load must be successful or create an error but not doing nothing.

- Marcus

datanibbler
Champion
Champion
Author

Hi Marcus,

I have found out the reason for this:

Up to now, I had no specifier (like >> (biff, no labels) << or something) in my LOAD inside the subroutine.

That worked fine for the pdf files, but without that, the xls files were not loaded.

When I add that, it works, I get one record for each file

=> I will have to make that into yet another variable and pass that to the subroutine, too.

I will keep you posted on how it goes.