18 Replies Latest reply: Oct 11, 2012 10:33 AM by Eric Smith RSS

    To check the End of File

    Leni Balakrishnan

      Hi,

       

      Is there any way to check the end of file??

       

      I have a requirement like, we have a list of folders and inside each folder a text file will be there whose name is same in all the folders.

       

      So I need to take data from those text files to Qlikview. Now I can fetch data from the text files but I need to have a field or a value to identify the end of each file.

       

      I will be using that filed or value in an another table to check whether It came from same file or from a different file.

       

      Is there any way to do this??

       

      Thanks in advance.

       

      Regards,

      Leni Balakrishnan

        • Re: To check the End of File
          Gysbert Wassenaar

          I don't quite understand what you are trying to achieve. What does that file look like? Is the content of the file always the same in every directory?

            • Re: To check the End of File
              Leni Balakrishnan

              Let me try to explain in detail.

               

              Example :

              20120930 ->log.txt

              20121001 -> log.txt

              20121005 -> log.txt

               

              The log.txt is a log file which will be created for each day. So the content in the log file will be different.

               

              I am loading all these log.txt from different folders (20120930,20121001,20121005) to Qlikview.

               

              So first it loads log.txt from 20120930 and then from 20121001 and then from 20121005 and so on.

               

              Now I need an information like the details are taken from 20120930\log.txt file, 20121001\log.txt file and so on.

               

              How to store this information.??

               

              A new folder will be created for each date. So I need to store this information dynamically

               

              Now I think this would have given you a picture on what i am trying to do.

               

              Thanks,

              Leni

                • Re: To check the End of File
                  Gysbert Wassenaar

                  Sorry, but I'm not understanding it quite yet. You have a number of directories, each of which holds a file named log.txt. The log files are created per date, so the number of directories will grow in time. You want to load each log.txt in qlikview. So you need a script that dynamically finds all the log.txt files and loads them. That's possible. Have you already achieved this?

                   

                  I assume the contents of the log files will have the same format, i.e same number of columns (or maybe just a line of text that can be split into columns). Is that correct?

                   

                  Next, you're talking about storing. What do you want to do? Load each log.txt and then store it as a qvd or excel file? Or do you want to store other information. Can you give some more details on what you want to do with the data once you've loaded it into qlikview?