5 Replies Latest reply: May 15, 2014 10:07 AM by Grant Perkins RSS

    multi-line field

    karenTC _

      Trying again to understand.  I have a multi-line field that always begins with an alpha character.  Yet if I use the alpha-character or non-blank trap, and end it with "blank field value" or "end of justification", it splits the field into multiple lines.  If I use a specific character, such as a "W", it works and puts all lines into one row.  Nothing else has been trapped at this point.  It seems so obvious and yet doesn't work.  :confused::confused:

        • multi-line field
          Olly Bond

          Hello Karen,


          This is because Monarch goes through the report line by line, looking for matches for each template. If your template uses a wildcard character (alpha or nonblank, for example) then it's going to hit a match on every line with an alpha or nonblank character in that column. Then it will create new record.


          You'll need to find different trap characters to cope with this - can you post a sample record here between and tags (without the spaces) so we can help?


          Best wishes,



            • multi-line field
              karenTC _

              Thanks Olly. 


              So the fact that you are saying not to end the record until you hit a blank line isn't relevant. 


              This is a question field, always ending in a blank, but not always starting with a blank.  If it's the first question on a page, there is no blank line above.  The following is column 1.  Next I'll need to capture the answer(s) in columns 2, 3 and 4. 


              How many days must pass between grace owed exports before 

              a subscriber can be included in another grace export run?

                • multi-line field
                  Data Kruncher

                  No, that's not what Olly meant to say, if can boldly intrude.


                  You're getting multiple records in the table because each line of (what you want to be) your multiline field matches the trap that you've defined in that template.


                  You'll need to either change the trap to something that doesn't involve that field, or make the template multi-line (maybe 10 lines if that's suitable?) so that Monarch won't treat each line as it's own record (which it's doing because every line matches the trap), only the first instance that matches for that whole group of data.


                  A bit clearer?

                    • multi-line field
                      karenTC _

                      Thanks guys.  I can't see a solution.  Unfortunately this field is the only constant in the report.  Every other field are variables.  I see that what Olly was saying is that it sees the start of each line before it looks at how to end the field.:(

                        • multi-line field
                          Grant Perkins

                          Thanks guys. I can't see a solution. Unfortunately this field is the only constant in the report. Every other field are variables. I see that what Olly was saying is that it sees the start of each line before it looks at how to end the field.:(/quote


                          Sometimes, especially with documents that are mostly free text variables of the time you seem to be dealing with here,  you have to look at an alternative strategy for modelling the report.


                          If you can work out what the general rules are by which you can identify where the question fields start there may be a way to add something to the report (using Monarch perhaps or an external editor or something else) to clearly identify that line and so give you a simple trap to work with using Monarch. It makes it a two (or more) step process but that hardly matters of you get the result.


                          So if the rules are something like


                          "Always the first line on a page OR a line preceded by a blank line."


                          you might be able to consider 2 document modification approaches to prepare the document.


                          One might be to add an extra blank line at the top of each page, thus making the blank line available to all records as a trap (except it's not a great trap if there are other blank lines around.)


                          Another might be to read in every line of the document complete in a single field and then use a calculated field to apply the 'rules' to add a unique marker character (or string) to the start (or end) of every line that represents the start of a record and a blank (or string of blanks) to the lines that do not. Then export the new version of the document (i.e. just the table column with your calculated field). Your 'marker' then provides you with the unique trap you need for 'regular' modelling.


                          There may be other possibilities  - these are just simple ideas to illustrate the concept - but without seeing and becoming familiar with the whole file and whatever interesting foibles it may contain (they usually have some foibles) it's difficult to be anything other than generic in a response. Therefore this is more about ideas than suggesting a full proof way forward. Does it suggest any possibilities or new ideas?