6 Replies Latest reply: Jan 3, 2017 4:38 AM by Marcus Sommer RSS

    Cannot connect to folder and / or Lib://

    Erik Sundblad



      I'm trying to import files from a directory.

      I'm using the following script:


      let vFolderPath  =  'lib://LOR';

      for each file in FileList(vFolderPath  & '/*.xls')


      FROM $file (txt, unicode, no labels, delimiter is '\t', msq, header is 10 lines);

      next file



      But when i do so i get this error:



      I've also tried using HIC's script, Re: loop through to load all files from a folder and its subfolders?

      But still I cannot get it to work!


      Anyone got any tips?

        • Re: Cannot connect to folder and / or Lib://
          Marcus Sommer

          Make sure that your lib is a valid path and you need to modify the variable-call like in tis way:


          for each file in FileList('$(vFolderPath)'  & '/*.xls')


          Further I noticed that you want to load xls-files but your file-format is from txt-files.


          - Marcus

            • Re: Cannot connect to folder and / or Lib://
              Erik Sundblad



              My path is a folder on our joint server, looking like this:



              It is a valid path when I use other ways of reaching it.. :/


              I've also tried this, however it does not seem to work neither,

              It cannot find any files, so the number of rows loaded is 0...


              Could it be a firewall issue or something?


              '' AS SourceFile
              AUTOGENERATE 0;
              sub ScanFolder(Root)
                        for each FileExtension in 'qvw'
                                  for each FoundFile in filelist( Root & '\*.' & FileExtension)
                                            LOAD '$(FoundFile)' as SourceFile
                     AUTOGENERATE 1;                             
                                            Set vConcatenate = Concatenate;
                                  next FoundFile
                        next FileExtension
                        for each SubDirectory in dirlist( Root & '\*' )
                                  call ScanFolder(SubDirectory)
                        next SubDirectory
              end sub

              Call ScanFolder('\\FS06\Users6\A63434\Skrivbord\Mål och Mina Listor\Qlick Analys\LOR uppföljning\XXX') ;