Community
    • Login

    Macro copy a particular line from a file(s) and paste in one specific file.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 359 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.
    • VijayPrabakarV
      VijayPrabakar
      last edited by

      ``

      I have to copy a particular line from a file(s) and paste in one specific file.

      How to achieve in macro in notepad++``

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

        @vijay-S

        So right away there are problems…

        a particular line

        Is this line 1235? Is this the line the caret is on? Or…?

        one specific file

        Presume you mean a file you have open in a tab in N++.
        So macros in general aren’t all that “tab aware”…
        I mean, well, maybe if this file you are talking about is always the FIRST tab, or the LAST tab, or…well, I don’t even really know…

        But, I wouldn’t put too much faith in being able to do what you seem to want with a macro. Maybe someone else will comment and prove me wrong.

        The reason I don’t really know is that I would quickly turn to a scripted solution for something like this.

        Plus it sounds like something that script code could do even outside of N++.

        But without more detail in the description, or even better a walk-thru example…hard to say…

        1 Reply Last reply Reply Quote 1
        • VijayPrabakarV
          VijayPrabakar
          last edited by

          ``
          To be more precise,

          First line is the package defintion of a java file. I want to open list of java files and copy the package definition line and paste in new.txt
          ``

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

            @vijay-S

            First line is the package defintion of a java file. I want to open list of java files and copy the package definition line and paste in new.txt

            Probably very clear to someone that works with Java often.
            Not so clear to someone that doesn’t.
            I wish you good luck in your endeavor at finding a solution.

            1 Reply Last reply Reply Quote 0
            • VijayPrabakarV
              VijayPrabakar
              last edited by

              ``Hi

              The requirement It is not very technical related to Java… I Just mentioned like that…

              My requirement is,
              Always the java file will have package line as below

              package com.abc.edf.*

              I want to copy this line from the list of all the java files and paste above package line only in new.txt file

              ``

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