1 Reply Latest reply: May 15, 2014 10:01 AM by Olly Bond RSS

    Help with parsing complex person details block

    cpasque _

      Aloha and thanks for your help.

       

      Using Monarch 9.1 Pro, I need some help to extract text from a recurring person details block.  It's tricky for several reasons.

       

      Each field is allowed two lines in case it needs to spill onto a second line

      The full block is fixed at 12 lines.  However three columns contain Name, Address, Telephone, Fax and Email.  Their positions are fixed in fixed rows within the block, but Name is 6 lines, Address 12 lines, Phone 4 lines, Fax 2 lines and Email 2 lines.

      In the actual file the column positions are floating, but let's ignore that for now.

      /LIST

       

      Here is the file format.  Each field can spill over to the second line.

      Name     Title                         Address   Address Line 1               Telephone         Phone 1

       

                First Name                              Address Line 2                                 Phone 2

       

                Last Name                               Address Line 3               Fax               Fax number

       

                                                        City                         Email             email address

       

                                                        State or Country

       

                                                        Zip code

       

      /CODE

      Here are sample lines in the file.

      Name     Mr                            Address   123 Street                   Telephone         0123456789

       

                John                                    2nd Floor                                      0123456780

       

                Doe                                                                  Fax               0123456789

       

                                                        Sometown                     Email             myemailaddressislone@ag

                                                                                      ency.us.gov

                                                        Maryland

       

                                                        20202

       

       

      Name     Mrs                           Address   123 Really long street       Telephone         0123456789

                                                        name

                Samantha                                2nd Floor                                      0123456780

       

                Doe                                                                  Fax               0123456789

       

                                                        Sometown                     Email             myemailaddressislone@ag

                                                                                      ency.us.gov

                                                        Maryland

       

                                                        20202

       

      /CODE

      Thank you for any suggestions on how to parse out each of the fields!  I can individually parse out Name, Address, Telephone, Fax and Email fields but cannot achieve all five.

        • Help with parsing complex person details block
          Olly Bond

          Hi CPasque,

           

          You mention in your post that:

           

          "In the actual file the column positions are floating, but let's ignore that for now."

           

          If you propose to fix the variable column positions using the floating trap, you won't be able to use all of the advanced field options which might help you trap the data you have on multiple lines.

           

          If the columns really aren't an issue, then assuming you can trap on something regular, then a single 12 line detail template with three multi-line fields for the Name, Address and Telephone blocks will get the data into the table. After that, you can clean up the data by making some calculated fields using the TextLine() function, e.g.: Email could be defined as TextLine(Telephone;7)+Textline(Telephone;8).

           

          If you can post an example of the report showing how variable the columns are, I'd be happy to suggest alternatives.

           

          Best wishes,

           

          Olly