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

    Trap paragraph in html file

    roldgoldberg13 _



      I am looking to trap paragraphs from htm files that will vary in length and number of rows depending on the file. The paragraph will always be preceeded by the phrase "Detailed Description/Comments" and will always end on "Assigned To:". I'm not sure how to go about doing this, any help would be greatly appreciated.


      Here is an example...I'd like to trap everything marked in bold and italics:


      Detailed Description/Comments

      <TABLE=024 NEST=07 ROW=013 COL=02 ID=0115>

      HREF="http://sharepoint.pbg.pvt/HQFSM/CPS/_layouts/userdisp.aspx?ID=20076" [I][B][SIZE=2]Thomas, Virginia HREF="javascript:" /SIZE[/B][/I][/I]

      [I][B][SIZE=2](HREF="http://sharepoint.pbg.pvt/HQFSM/CPS/Lists/Request%20Form/DispForm.aspx?ID=2641&Source=&VersionNo=512" /SIZE[/B][/I][/I]

      [I][B][SIZE=2]9/10/2012 1:47 PM): 620427 Quarterly Rebates, should have dropped for Q3, The programs for this contract /SIZE[/B][/I][/I]

      [I][B][SIZE=2]say error after approval/some are also saying setup error. The error report says that there must be /SIZE[/B][/I][/I]

      [I][B][SIZE=2]a cof attached to the key account. There are many cof's attached to the key account? The previous stub /SIZE[/B][/I][/I]

      [I][B][SIZE=2]program for rebates dropped so what is the problem with the new contract. I see that I attached the /SIZE[/B][/I][/I]

      [I][B][SIZE=2]key account at the BU level for the stub contract. For the newer contract I added the key accounts in /SIZE[/B][/I][/I]

      [I][B][SIZE=2]according to region, eg West, East, Ontario. If I redo this whole contract how do I know that the same /SIZE[/B][/I][/I]

      [I][B][SIZE=2]thing isn't going to happen again. Please let me know what the issue is here. Thanks Virginia[/SIZE][/B][/I][/I]<TABLE=024 NEST=07 ROW=014 COL=01 ID=0116>

      Assigned To:

      <TABLE=024 NEST=07 ROW=014 COL=02 ID=0117>

        • Trap paragraph in html file
          Olly Bond

          Hello roldgoldberg,


          Sharepoint can also export to Excel, from which it might help to open it in Monarch and then export to fixed width text to get something useful to work with, but with fields over 254 characters you're going to run into problems that way.0


          HTML can be a pain - as the programs generating can make really fiddly tables - so sometimes I've found using Monarch Utility to prep HTML files helpful. This way lets you convert all line feeds followed by </ tags to just </, and so you end up with nice neat lines in a report like:


          Detailed Description/Comments

          the text you want to trap... ... ...



          which you can parse easily as a text report, assuming you don't hit the 4000 character limit for the width of a single line.


          In your case, this approach might be needed, but I'd need to see a proper sample first to see how the other table elements fit in.


          If it's well-behaved, using the "Detailed Description/Comments" as the first line of a two row sample, grabbing a multi line field ending on a suitable stopper template, and cleaning up with Extract() should do the trick.


          Best wishes,