2 Replies Latest reply: Apr 16, 2014 9:43 PM by Julio Lourenco RSS

    Loading statements to achieve the desired shape

      Hey guys, I have a script that works with a .txt file that is attached. Recently I change this to a .brn file (specific from another program). When I load it inside, data comes different, with no tabs or spaces...

       

      If you change the load to spaces as delimiter, data looks the better I can get, but i need to look like the .txt file, so it works...

       

      Can someone help me out shaping this data?

        • Re: Loading statements to achieve the desired shape
          Vamshi Tataipelli

          Hi,

           

          I have opened the .txt file and saved it as .brn file and tried to load the .brn file and found it is showing similar to that of .txt file.

            • Re: Loading statements to achieve the desired shape

              yes, they are basically the same file, but i want a direct connection to the .brn, without having to save it as a .txt file... my script is working like this:

               

              Raw:

              LOAD @1,

                  @2,

                  @3,

                  @4

              FROM

              [My restaurant.txt]

              (txt, codepage is 1252, no labels, delimiter is '\t', msq, header is 0 lines, filters(

              Replace(1, top, StrCnd(null))

              ));

               

               

              Menu:

              LOAD

                @1,

                if(@2='',peek('Course', RowNo()-2), @2) as Course,

                if(@3='',peek('Plate', RowNo()-2), @3) as Plate,

                @4 as Food

              RESIDENT Raw

              WHERE @1 = 'Menu'

              ;

               

               

              Foods:

              LOAD @1,

                if(@2='',peek('Course', RowNo()-2), @2) as Course,

                if(@3='',peek('Plate', RowNo()-2), @3) as Plate,

                @4 as Food

              RESIDENT Raw

              WHERE @1 = 'Foods'

              ;

               

               

              Ingredients:

              LOAD @1,

                if(@2='',peek('Course', RowNo()-2), @2) as Ingredients1

              // if(@3='',peek('Dish', RowNo()-2), @3) as Dish,

              // @4 as Ingredient

              RESIDENT Raw

              WHERE @1 = 'Ingredients'

              ;

               

              will it work out the same if I use the ".brn" file?