Community

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

    line by line modification using macro

    Help wanted · · · – – – · · ·
    5
    9
    336
    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.
    • Faisal Khan
      Faisal Khan last edited by

      Hello, I have tried but was not successful…
      I have a list of links , for example following ( three shown but they can be any number)

      https://i.imgur.com/ZbiS6MR.png
      https://i.imgur.com/Xjdr5eq.jpg
      https://i.imgur.com/ZehH59y.png

      I would like to paste them in notepad++ blank file starting with first row. I would like to run macro so that notepad can add bracket before and after i.e “(” in beginning of each line and “)” at the end of each line and give me the output. so output should be following
      (https://i.imgur.com/ZbiS6MR.png)
      (https://i.imgur.com/Xjdr5eq.jpg)
      (https://i.imgur.com/ZehH59y.png)

      The old lines should be deleted. This should be done on any number of rows pasted in that document.

      astrosofista 1 Reply Last reply Reply Quote 0
      • carypt
        carypt last edited by

        your image-link show me no code or text nor number . some random trash is displayed instead . no data , no advice for no data . sry :)

        Faisal Khan 1 Reply Last reply Reply Quote 0
        • Faisal Khan
          Faisal Khan @carypt last edited by

          @carypt sorry, these links are just examples, no need to see data …as they are not related to the purpose of the question. The purpose is to append certain character to the beginning and end of a line. Visiting these links would not help in any way answering the question.

          1 Reply Last reply Reply Quote 0
          • TroshinDV
            TroshinDV last edited by

            @Faisal-Khan said in line by line modification using macro:

            The old lines should be deleted. This should be done on any number of rows pasted in that document.

            I do a similar job using MS Excel and its Concatenate function.
            I have a trdmBrackets.js script in my repository that does a similar job, but to select either one line.
            alt text
            You can also modify it to process all the text.

            1 Reply Last reply Reply Quote 1
            • Faisal Khan
              Faisal Khan last edited by

              thank you, can you guide , from where I can copy your script

              TroshinDV 1 Reply Last reply Reply Quote 0
              • astrosofista
                astrosofista @Faisal Khan last edited by

                Hi @Faisal-Khan, All:

                As long as the data provided is representative, the following regex may do the job:

                Search: (?-s)^(https.+)$
                Replace: \($0\)
                

                Put the caret at the very beginning of the document, select just the Regular Expressions mode and click on Replace All. You can record it as a macro and save it for later use.

                Have fun!

                1 Reply Last reply Reply Quote 3
                • TroshinDV
                  TroshinDV @Faisal Khan last edited by

                  @Faisal-Khan said in line by line modification using macro:

                  thank you, can you guide , from where I can copy your script

                  My script works in conjunction with the jN plugin as well as some ActiveX, so its installation is difficult for a beginner. Additionally, I just made edits in the local repository to frame all lines. You will need to update the repo on GitHib.

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

                    A script feels a bit “heavy” for this simple operation.
                    I’d go with the regular-expression-replace method.
                    If it is a recurring need, record a macro out of it, then it will appear in a menu, a bit like the script’s (again showing that the simpler solution is probably better in this case).

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

                      @Alan-Kilborn said in line by line modification using macro:

                      A script feels a bit “heavy” for this simple operation.

                      This is if we mean only this operation.
                      In fact, there are many possibilities as the brackets are customizable.
                      Often it is necessary, for example: to complete the lines on the right or left.

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