Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
anagha9489
Partner - Contributor
Partner - Contributor

Pulling a data from files

Hi Team,

I am using below script for pulling the data from particular path which is having excel files.T he excel files count are increasing day by day and below script is taking more and more time to get just the file details.

FOR Each File in filelist((Path))

FileDetails:
Load FileTime('$(File)') as FileTime,
'$(File)' as PathName
AutoGenerate 1;
Next File;

is there any alternate way to get all the data of excel files.

Labels (1)
2 Replies
paulselousyoriz
Partner - Contributor III
Partner - Contributor III

You need to use a delta or incremental reload here. 

For the next time you run the script add a  line of code to store the FileDetails table in a qvd after the loop:

"

Set Path='E:\Test\File_*.qvd';

FOR Each File in filelist((Path))

FileDetails:
Load FileTime('$(File)') as FileTime,
'$(File)' as PathName
AutoGenerate 1;
Next File;

Store FileDetails into ['E:\Test\FD.qvd'] (qvd);"

 

Then amend the code so you read the qvd in before the loop and then in the loop do a Concatenate Load if a certain condition is met, such as the filetime being greater or equal to today and then at the end do not forget to leave in the new line of code to store the table to the qvd file:

"

Set Path='E:\Test\DM_*.qvd';


FileDetails:
Load
*
From ['E:\Test\FD.qvd'] (qvd);

FOR Each File in filelist((Path))

If NUM(FILETIME('$(File)')) > Num(Today()) Then

Concatenate(FileDetails)
Load FileTime('$(File)') as FileTime,
'$(File)' as PathName
AutoGenerate 1;
End If

Next File;

Store FileDetails into ['E:\Test\FD.qvd'] (qvd);

"

Let me know if this solves your problem.

Paul

 

anagha9489
Partner - Contributor
Partner - Contributor
Author

Hi ,

This is same what I am doing in the incremental script .But file functions like FileTime('$(File)')  is taking time to get the file details. Is there any other way or any command by which i will get full list of files and its details like last modified time.