4 Replies Latest reply: May 15, 2014 9:51 AM by Grant Perkins RSS

    blank lines within group and page spanning

    Dan _

      Hello, I'm still somewhat new to Monarch and am using V7.01 Pro.  I have a bit of a multi line challenge complicated by data spanning page headers.


      Basically a record group for me is:

      Line 1  an id #

      Line 2  a name

      Line 3  addr 1

      Line 4  addr 2 or may be blank

      Line 5  city state zip or may be blank

      Line 6  city state zip or may be blank

      Line 7  blank

      Line 8  a subheader within the record group

      Line 9  an owner line

      Line 10 - n optionally more owner lines


      And a page break may occasionally come after line 1 when the record group is near the bottom of a page with multiple blank lines before line 2 resumes on the next page.


      I got rid of page headers with a pagehdr template

      and I am treating the owner lines (9 - n) as my detail and all that seems to work well.


      I am then trying to capture lines 1 - 6 with a multi line appends template.  Using a 5 digit numeric trap I catch lines 1 - 3 fairly well.


      After that I have problems with the unpredicatable blank lines and also have problems when the record group spans a page.


      Any help would be appreciated.  Thanks.


      [font="courier"]                                  15182                                                                               

      M.B.S. Fashion                                                                     2/11/04 

                                                     3548 WHITE PLAINS ROAD                                                                               

      BRONX               NY       10467                                                                               

      OwnerName                   Addressl                              Address2                 City         St    PostalCode

                       Mohmed Sow                   441 East 147th Street                                           Bronx        NY    10455    


      Page:             Page 1 of 111                                                                               

      User:             PSEMLEY                                                                               

      Date:             3/11/04                                                                               

      Time:             09:37 AM                                                                               

      ConmpType                    IndexNo          CompName                               ASNNane                                     Filing   

                                                   Addressl                                                                            Date     


      City                State     Postal                                                                               


      D&D Cuts and Creation                                                              2/17/04  

                                                    561 EAST 187TH STREET                                                                               

      BRONX                NY       10458-80                                                                               

      OwnerName                    Addressl                             Address2                 City          St    PostalCode

                       Dorothy Angela Williams      1670 Bryant Avenue                                             Bronx         NY    10460    

                       Dorothy A Williams           1670 Bryant Avenue                                             Bronx         NY    10460    


        • blank lines within group and page spanning
          Grant Perkins

          Hi Dan,


          Copying the sample format you posted I did the following.


          Made the 'Owner' lines the detail template trapping on Alphe character for state code and numeric for the zip/geo on the detail line. (I assume 2 lines if 2 'owners' is OK and can be eliminated later if required. There are other approaches of course.)


          I then set an append for 'Business Address' which appears to have a consistent 5 line format, though some address lines may be blank. I trapped that using the State Code and zip/geo on line 5 of a 5 line template.


          I set another append for the ID #  (Index number) basing the trap on numerics in that position.


          Finally I set the Page Header to be 11 lines (although 15 (?) to include the secondary headers for the business info or less to exclude them, might be necessary to satisfy other parts of the report.) No fields defined.


          That gave me 3 owner records with appropriate business address and Index numbers associated with them. All looked OK.


          Is it more of a problem with a larger sample? Or are there some other aspects that you are hoping to analyse that I have missed?


          If not I think what you described as your current model is very close to getting the results you want.


          The Cut and Paste of the sample seemed to move the data on a few lines - unless it really is character shifted?


          If you can't get it to work send me a PM with an email address and I will the model I created by return and we can see if it works for the whole report. I assume that emails with attachments are an option. If not we may need to find another way.


          Best regards,




          • blank lines within group and page spanning
            Dan _

            Thank-you very much Grant for your reply.  I buckled down over the weekend and was able to do a lot of similar templates to what you came up with.  I went a couple of different ways in that the number of Owner lines is variable, but that seemed to work okay with the detail template.  On the Business Address, yes it is generally 5 lines, but the state and zip you trapped for are sometimes on line 3 or 4 or 5, don't know if that would be a problem on your trap if only looking at line 5.


            This file has some challenges as follows:

            • it is scanned in, so fields tend to float and misspellings are common.

            • there aren't a lot of significant literal tags aligned with data to trap against.

            • the number of lines in multi line groups varies and is not a fixed number.


            The biggest challenges I still have against the whole file are:

            • Not every record grouping has owner detail lines.  In that case I am not getting any output for the higher level appends that contain the indexno and business address, so I am losing data.

            • My record groups basically start with ID # (that index number you mentioned), but I had difficulty coming up with the right template/trap combination to capture the indexno, the biz name, and then the biz address lines.  I finally came up with something, but it probably won't work if data tends to shift a little bit one way or the other.


            I really wanted to use the "Float" option a lot in this project, but found it very restrictive.  For instance, since indexno is 5 numbers a float will capture it, but then all of the data that had 5 digit zip codes as well.  I couldn't figure out how to make the float tighter to just get those lines.



            I would be happy to send you my input file and my project files if you want to take a look, the problem with dropping parent data when there are no detail children recs is a show stpper for me right now.




            • blank lines within group and page spanning
              Grant Perkins



              Somewhere at the back of my mind I guessed that this was not going to be as straightforward as it looked ...


              OK, 'floating' fields can sometimes be overcome simply by making them a little oversize and then re-formatting if required to remove blanks and so on. However, with your additional potential 'disruption' from the scanning process it may be rather difficult to achieve a 100% reliable result with that idea.


              Even with that problem resolved you rightly point out that the lack of literal tags doesn't help your cause. The variable number of lines in the address block (again I had a fear that it would not be consistent) presents a few issues and the lack of records in the chosen 'Details' section does seem to be a problem, implying that the real detail is the main business record.


              Never fear - we simply need a revised approach and there are several routes we can look at, each getting a little more complex than the one before.


              I will happily have a look at a full report file sample and your models. (I assume that the scanning requirement means that each report could potentially  be different to the one before in terms of horizontal and vertical location of information so the ultimate solution needs to deal with that if necessary). If you send me a Private Message with your email address (You seem to have Private Messaging disabled or I would have sent my address earlier) I will give you an address to mail to.


              In the meantime I will see what alternatives I can come up with using the posted sample.


              Best regards,



              • blank lines within group and page spanning
                Grant Perkins



                I couple of ideas so far.




                Make a Page Header template as before - all main header title lies need to be included I reckon.




                Make the whole record from the ID number to the first owner line the detail record.


                Paint the ID number field.


                Forget the Business address for now.


                Paint the ENTIRE Owner field width as a single field and make it a multi line field with a suitable 'End on' setting. Blank field values looks OK on the sample. We can split the field later depending on your requirements. Set the 'Start field on' value to 'ownername' "anywhere in previous line".




                It is difficult to get the business address out from the detail section as there is on tag to use to ID the start. So try adding an append template to get the name and address.


                I set one up using a trap of blanks from the left of the report up to the earliest possiblt start of any character in the first line of the name/address fields. (They may float a little?). Then a single 'non-blank' trap.


                Paint the field (single line) for a suitable width to capture ALL address details on any of the 5 lines available in the addresses anywhere on the report. Make this a multi-line field. I set the 'End on' to a line count of 5 but, from what you wrote previously, this may need to be amended for the full report.




                Once the fields ar extracted to the table you can use the 'address block' feature to split the address up into separate fields if required. Both the Business address and the Owner details address CAN be ATTEMPTED with some success BUT do include the error code for when the parse fails!


                (It is worth spending some time searching and browsing the Help index and files if you have not played with this feature before.)


                Of the 2 addresses in the sample, one worked fine, the other (D&D Cuts and Creation) seems to have a partial ZIP format which gives a partial result and an error code.


                I also used the Address Block on the Owner details lines. Interesting.


                With just a single owner it worked OK to separate the City/Region/ZIP but, not unreasonably, left the Earlier lines of the address as a single field.


                The record with 2 owners was similar with the restriction that only the LAST part of the line (i.e. the last address) was attempted. If it is a requirement to separate records for multiple owners we need to look at some of the other methods of pre-processing to split the field up before applying the address block parsing.



                If these ideas still leave insurmountable problems we may need to consider a 2 stage process where stage one re-formats the report and filters out any unwanted and un-useful lines and then prints to a disk file. Stage 2 then models against the new report the extract the data as required.


                By doing that there is an opportunity to include helpful tags (retain existing or add new) and strip unhelpful spaces, headers and blank lines, etc.


                If the scanning process is as variable as I suspect it might be the 2 stage process might be worthy of early consideration!


                I hope this is of interest.