Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Insert xml row

    Help wanted · · · – – – · · ·
    3
    5
    175
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TJ Druid
      TJ Druid last edited by

      I read another post on here and tried following the instructions to use Regex to do this. But when I do the Find, nothing is found.

      My current record looks like:
      ab482928-a992-45f8-bb66-c9c121d23b3a-image.png

      I need to insert a row between PlanDetail and CustomProperties.
      <RemitProvider RemitProviderName=“Payment Center” RemitProviderTIN=“777336666” RemitProviderID=“777336666” />

      I wasn’t sure if my Find/Replace settings might need a tweak - but I tried suggestions from another thread here and had no luck:
      3c137eb5-1a15-4d1c-8e00-b802146eb0ba-image.png

      Any help will be greatly appreciated. I’m trying to help someone else on my work team.

      Thanks!

      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @TJ Druid last edited by

        @TJ-Druid

        I’d try a Find what of (?-is)(<PlanDetail.+\R)(?=\x20{4}<CustomProperties) and a Replace with of \1<RemitProvider blahblahblah />\r\n

        Replace by blahblahblah with your blahblahblah. :-)

        You’ll want to change your Search Mode to Regular expression for this.

        TJ Druid 1 Reply Last reply Reply Quote 1
        • guy038
          guy038 last edited by guy038

          Hello, @tj-druid, @alan-kilborn and All

          Oh ! Seemingly, Alan beat me to it ;-))

          First, just one question :

          Is the line <PlanDetail xsi:nil="true"> always identical ? ( as I suppose that you have several lines, beginning with <PlanDetail, in your current HTML file )

          If the answer is yes :

          • SEARCH <PlanDetail xsi:nil="true">\r\n

          • REPLACE <PlanDetail xsi:nil="true">\r\n\x20\x20\x20\x20<RemitProvider RemitProviderName="Payment Center" RemitProviderTIN="777336666" RemitProviderID="777336666" />\r\n

          • Tick the Wrap around option

          • Select the Extended search mode

          • Click once on the Replace All button or several times on the Replace button


          If the line, beginning with <PlanDetail, may be different : for instance <PlanDetail xsi:nil="false"> or <PlanDetail abc:nil="true"> ), I advice you to prefer the regex mode :

          • SEARCH (?-is)<PlanDetail\x20.+\R(?=\h*<CustomProperties)

          • REPLACE $0\x20\x20\x20\x20<RemitProvider RemitProviderName="Payment Center" RemitProviderTIN="777336666" RemitProviderID="777336666" />\r\n

          • Tick the Wrap around option

          • Select the Regular expression search mode

          • Click once on the Replace All button or several times on the Replace button

          Best Regards,

          guy038

          P.S. :

          Here are two links to get further documentation :

          https://npp-user-manual.org/docs/searching/

          https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation

          TJ Druid 1 Reply Last reply Reply Quote 1
          • TJ Druid
            TJ Druid @Alan Kilborn last edited by

            @Alan-Kilborn Thank you! I ended up using guy038’s suggestion. But, I did start with yours.

            1 Reply Last reply Reply Quote 1
            • TJ Druid
              TJ Druid @guy038 last edited by

              @guy038 Thank you so much. I ended up using your second suggestion. I ran into an issue because my validator did not like the new row between PlanDetail and CustomProperties, but I was able to take what you provided and put the row after CustomProperties instead. I was helping a coworker with a temporary work around and she thanks you too! Happy Holidays, I’m sure Santa will give you something good in your stocking - or at least some good Karma!

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              Copyright © 2014 NodeBB Forums | Contributors