6 Replies Latest reply: May 15, 2014 9:51 AM by Dan _ RSS

    Single space delimiter

    Wayne _

      I am a new Monarch user and I have a problem that I haven't been able to fix.  I did a search but was unable to find an answer.  When I use a multiple line trap I have found that Monarch puts a space between the lines that I trap.  This is causing me a problem because I then try to link this field with a database field and I get no data because of the spaces.  Is there someway to supress the spaces so that the numbers flow together?  I am using Monarch V7 Pro.  :confused:

       

      [size="1"][ April 12, 2004, 04:07 PM: Message edited by: Wayne ][/size]

        • Single space delimiter
          Nick Osdale-Popa

          This [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000099#000002"]post[/url] will show you the formula to correct it.  If you read the full thread, you'll get the explanation behind it.

           

          Hope that helps!    [img]smile.gif[/img]

           

          [size="1"][ May 01, 2006, 05:37 PM: Message edited by: Todd Niemi ][/size]

          • Single space delimiter
            Wayne _

            Thanks Nick.  I understand what is happening now but I applied the formula and the results still had the space.  Here is an example of what I am looking at. 

            1.5-NS2-         

            11F9B9B3C3C3CGGG3O

            I0M2T            

            When I trap it I get

            1.5-NS2 11F9B9B3C3C3CGGG3O I0M2T

             

            The field is called Item, so I used the formula

            RTrim(LSplit(,2,Chr(13),1))+RTrim(LSplit(,2,chr(10),2))  It returned exactly the above.  Some items have two segments and some have three.  Is that a problem?

            • Single space delimiter
              Grant Perkins

              Hi Wayne,

               

              A well remembered reference from Nick but much of it related to V 6 vs V 6.01 and the inclusion of in multi line fields in 6.01.

               

              V7 should be a little easier.

               

              Not sure where your second "-" went but removing a space means you are looking for chr(32) rather than 13 or 10.

               

              However even easier is to use the STRIP function new in V7.

               

              STRIP(ITEM," ")

               

              n.b. there is a space between the quote symbols

               

              should do it if I have interpreted your requirement correctly.

               

              Won't work if the string has a required "space" anywhere. So ...

               

               

              OR

               

              LSplit(Item,2," ",1)LSplit(Item,3," ",2)LSPLIT(Item,3," ",3)

               

              Adjust the LSPLIT function according to how many spaces, and therefore 'sections' nof the field,  there may be.

               

              RSPLIT could also be used working from the right ... 

               

              BTW, ITEM or will work. The enclosure is only required for field names with more space separated multi string names, hence I left them out above. However including it in examples can make a formula easier to read.

               

              Hope this is helpful.

               

              Grant

               

              Originally posted by Wayne:

              Thanks Nick.  I understand what is happening now but I applied the formula and the results still had the space.  Here is an example of what I am looking at. 

              1.5-NS2-         

              11F9B9B3C3C3CGGG3O

              I0M2T            

              When I trap it I get

              1.5-NS2 11F9B9B3C3C3CGGG3O I0M2T

               

              The field is called Item, so I used the formula

              RTrim(LSplit(,2,Chr(13),1))+RTrim(LSplit(,2,chr(10),2))  It returned exactly the above.  Some items have two segments and some have three.  Is that a problem? /b[/quote]

              • Single space delimiter
                Nick Osdale-Popa

                Try this formula:

                Strip(,Chr(13)+Chr(10))

                • Single space delimiter
                  Wayne _

                  Thanks guys.  This is very helpful.  I will try not to bother you too much but I am sure I will run into other things that I will need help with.

                  • Single space delimiter
                    Dan _

                    I've been following this post looking for a slightly different solution.  I have a multi line field that is actually made up of two separate lines that I can't distinquish from each other using different traps.

                     

                    I trap as multiline (ok) and identify the field as MEMO type (ok).  If I copy the cell contents from Monarch's table display into an external ascii editor I see:

                    Line 1 09 0D 0A

                    Line 2 text bytes (data line 1) followed by 0D 0A

                    Line 3 text bytes (data line 2) followed by 0D 0A

                    Line 4 09 0D 0A

                     

                    I want to separate the two data fields back into separate columns by splitting at the CRLF using a formula based column.  No matter what functions I try lsplit, asc, chr, substr, len etc. it appears like the CRLF's are not in the actual workarea the function is parsing (the source column).  I've tried CHR(13) and CHR(10) and it is like they don't exist.  I am using Monarch Pro V7.01.  Is there some behavior that has changed where the column is not retained as a memo type in the work area the formulas would be interacting with?

                     

                    thanks,

                    dan