Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

for each dir

Hi All,

The problem iam facing with the script is .. it always takes the source files only from where the qvw is placed. Even changing the path to the different drive it does take the file from their..

All my files are placed in a folders like 2014.csv /2015.csv etc.. so the csv  file names are like file1-2014. so here file1-2014 needs to be into product. similarly I have file2-2014...etc

sub GetCSVFIleNames(Root)

    for each FoundFile in filelist( Root & '\*.csv')
   
    FoundFile = right('$(FoundFile)', 8);

Product:
LOAD

Customer Number,
    Customer Name,
     Product name] as [Product Name],
     [Product  number] as [Product Number]
    
FROM
['$(FoundFile)'\file1-'$(FoundFile)']
(txt, codepage is 1252, embedded labels, delimiter is ',', msq, header is 1 lines);


    next FoundFile

    for each SubDirectory in dirlist( Root & '\*' )

        call GetCSVFIleNames(SubDirectory)

    next SubDirectory

end sub

Call GetCSVFIleNames('H:/') ;

22 Replies
Not applicable
Author

I don't find this correct answer option to close it..or is it helpful ?

sasiparupudi1
Master III
Master III

If you have logged on to the portal you must see the options to select a correct answer option with a green *

may be this post can help you

https://community.qlik.com/message/867616#867616

thanks

Sasi

Not applicable
Author

hi sasi.

Iam facing a small problem here. when iam processing the same file in 2 load statements. it is only considering the first load statement..

second it is not loading