• Login
Community
  • Login

Q: How to duplicate text with adding line between two certain words?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 4 Posters 1.7k Views
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.
  • Z
    Ziad Aborami
    last edited by Feb 19, 2019, 11:33 AM

    Hello,
    I’am starter and I don’t have a lot experience.

    I have text file in this pattern:

    <span style=“color:darkblue”>some thing</span> some words

    <span style=“color:darkblue”>some thing else</span> another some words

    <span style=“color:darkblue”>some thing 1</span>another some words 1

    what I want to do:
    Duplcating the word between <span style=“color:darkblue”> and </span>
    then put it between <span class=“bold”> and </span>
    then put the duplicated result in the upper line

    <span class=“bold”>some thing</span>
    <span style=“color:darkblue”>some thing</span> some words

    <span class=“bold”>some thing else</span>
    <span style=“color:darkblue”>some thing else</span> another some words

    <span class=“bold”>some thing 1</span>
    <span style=“color:darkblue”>some thing 1</span>another some words 1

    That seems a little difficult
    Is that possible?

    Thanks in advance

    E 1 Reply Last reply Feb 19, 2019, 12:19 PM Reply Quote 1
    • I
      informagenie
      last edited by Feb 19, 2019, 12:18 PM

      What you want, You can do that easly with combinaison of ctrl+c and ctrl+v

      I don’t know what do you mean by duplicate…

      M 1 Reply Last reply Feb 19, 2019, 1:05 PM Reply Quote 0
      • E
        Ekopalypse @Ziad Aborami
        last edited by Feb 19, 2019, 12:19 PM

        @Ziad-Aborami

        select regular expression mode in find/replace dialog.
        find what should be <span style="color:darkblue">(.+?)</span>
        and replace with would be <span class="bold">$1</span>\r\n$0

        Z 1 Reply Last reply Feb 19, 2019, 12:40 PM Reply Quote 4
        • Z
          Ziad Aborami @Ekopalypse
          last edited by Feb 19, 2019, 12:40 PM

          @Ekopalypse Thanks very much!

          That works for me :)

          best wisches

          1 Reply Last reply Reply Quote 1
          • M
            Meta Chuh moderator @informagenie
            last edited by Meta Chuh Feb 19, 2019, 1:06 PM Feb 19, 2019, 1:05 PM

            welcome to the notepad++ community, @informagenie

            What you want, You can do that easly with combinaison of ctrl+c and ctrl+v
            I don’t know what do you mean by duplicate…

            please do not respond to a thread, if you are not ready to give a valid or useful answer.

            1 Reply Last reply Reply Quote 2
            • Z
              Ziad Aborami
              last edited by Feb 19, 2019, 3:08 PM

              <span class=“bold”>$1</span>\r\n$0
              that puts the result in the buttom line like this

              <span style=“color:darkblue”>some thing</span> some words
              <span class=“bold”>some thing</span>

              What I need is like this

              <span class=“bold”>some thing</span>
              <span style=“color:darkblue”>some thing</span> some words

              E 1 Reply Last reply Feb 19, 2019, 4:28 PM Reply Quote 0
              • E
                Ekopalypse @Ziad Aborami
                last edited by Feb 19, 2019, 4:28 PM

                @Ziad-Aborami

                not for me - I get the result like expected.

                Z 1 Reply Last reply Feb 19, 2019, 4:40 PM Reply Quote 3
                • Z
                  Ziad Aborami @Ekopalypse
                  last edited by Feb 19, 2019, 4:40 PM

                  @Ekopalypse Thanks for help
                  It works now,
                  I have made a mistake

                  1 Reply Last reply Reply Quote 2
                  2 out of 8
                  • First post
                    2/8
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors