3 Replies Latest reply: Oct 8, 2013 4:15 AM by Antoine Frangieh RSS

    Brackets within a load script

    Antoine Frangieh

      Hello,

       

      I have a record that looks like this:

      LOAD * INLINE [

      A, B, C

      b, m, a;b;c;e;f;g;h;i;j;k;l;m;n

      ]

      ;

       

      What I would like to obtain is the following:

      A, B, C

      b, m, b;c;d;e;f;g;h;i;j;k;l;m

       

      I have expanded the record using SubField(C, ';') and flagged the b and m records and removed the "noise" values (a and n)

      Is there a more elegant way to do this? since I have a lot of records.

       

      Thanks,


      Antoine

        • Re: Brackets within a load script
          Rob Wunderlich

          One approach would be:

           

          LOAD

            A,

            B,

            A & TextBetween(C,A,B) & B as C

          INLINE [

          A, B, C

          b, m, a;b;c;e;f;g;h;i;j;k;l;m;n

          ];

           

          -Rob

          http://masterssummit.com

          http://robwunderlich.com

          • Re: Brackets within a load script
            Stefan Wühl

            Sorry, I don't really understand what you are trying to do, or better said, what the requirement is and which logic should be applied.

             

            Using subfield() may be a reasonable way to do what you want, but without knowing what you need, it's hard to say.

            Why don't you just post your current script and explain a bit more what you need to do in a more abstract way (how do you determine the noise values, for example? What are fields A, B for? do you need to concatenate the C values again after removing the noise?).

             

            So maybe someone can suggest a more 'elegant' way or at least some alternative implementation.

              • Re: Brackets within a load script
                Antoine Frangieh

                Sorry Stefan if I was unclear.

                I will still use subfield at a later step.

                I needed to reduce information noise, meaning the values a and n that do not belong to the values between b and m.

                 

                I didn't want to post the entire code because I would have to place lots of code and people might not have the patience to read several lines of script. Hence the simplification.

                 

                Ultimately
                What I am trying to do is create a bracket to perform interval matching.

                 

                Thanks for both of you

                Antoine