Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewjbryant
Creator II
Creator II

Using FileName() without loading all data

I have a folder of daily Open Order extracts in QVD format. The files are named D_OO_YYYYDD. I want to create a table of all dates that are accounted for.

I could Load FileName() From D_OO_*.qvd, but then all the data is ran through for each QVD. Is there a better way?

1 Solution

Accepted Solutions
Michiel_QV_Fan
Specialist
Specialist

Yes:

for each vFile in FileList('your path\*.qvd')

load

     '$(vFile)' as Filelistnames

autogenerate(1);

next vFile

View solution in original post

6 Replies
Michiel_QV_Fan
Specialist
Specialist

Yes:

for each vFile in FileList('your path\*.qvd')

load

     '$(vFile)' as Filelistnames

autogenerate(1);

next vFile

jagan
Luminary Alumni
Luminary Alumni

Try First option

Data:

First 10

Load FileName() From D_OO_*.qvd;


Data:

Load FileName() From D_OO_*.qvd

WHERE RecNo() = 1;


Hope this helps you.



jagan
Luminary Alumni
Luminary Alumni

Hi,

This is working for me

Data:

First 1

Load FileName()

From D_OO_*.qvd (qvd);

OR

Data:

Load FileName() From D_OO_*.qvd

WHERE RecNo() = 1;


Both are working, but first one is faster.


Regards,

jagan.

matthewjbryant
Creator II
Creator II
Author

I thought there had to be a loop! Thanks

jagan
Luminary Alumni
Luminary Alumni

Looping will take more time.  Instead use First N option.  It is faster.

Regards,

Jagan.

matthewjbryant
Creator II
Creator II
Author

I've just tried it, but I'm finding the loop much quicker. Maybe it's because the data is stored on a networked drive and not my local PC.

Edit: Logically though, it makes more sense that the loop would be quicker as it just has to look at the file names, which it has to do anyway to load the data.