• Login
Community
  • Login

Get 1 line from more than 200 files with an expression and put them into 1 file with filename

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
3 Posts 2 Posters 204 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.
  • M
    Márk Birtalan
    last edited by Jun 7, 2020, 12:51 PM

    Hey guys,
    I have like 200 files, from which i gotta get out 1line/file which has an exact expression(“$hbox”). I have to systematize them, so I can work with them later much more easier. Also I have to know from which file are the lines from.

    Thought about something like this:
    <line1> | <file1name>
    <line2> | <file2name>
    …

    I’d be glad if y’all could help me, even if not like how I imagined it!

    I don’t really know the borders of notepad++ and I really don’t know where else i could ask for help or manage to do this, so if I’m at the wrong place, I’d be glad for some redirection.

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by guy038 Jun 7, 2020, 2:53 PM Jun 7, 2020, 2:52 PM

      Hello, @márk-birtalan, and All,

      Natively, Notepad++ can show you all the files containing your string "$hbox" as well as all the lines containing this string ;-))

      Here is a quick road map :

      • Open the Find in Files dialog ( Ctrl + Shift + F )

      • Type in "$hbox" in the Find what: zone

      • Type in "$hbox", again, in the Replace with: zone ( To avoid problems in case of confirmation of the replacement ! )

      • Choose your file filters in the Filters zone, if any

      • Type in the absolute path to your files to scan, in the Directory zone ( They must all belong to a same folder )

      • Untick the Match whole word only option ( IMPORTANT )

      • Tick the Match case option

      • Select the Normal search mode

      • Click on the Find All button

      => After searches, a Find result panel is displayed, containing all lines, with a string "$hbox", of all your files scanned

      Then, while double-clicking on any line of that list, the associated file is selected/opened and cursor moves to the exact occurrence of the string "$hbox", in the corresponding line !

      You may save all these locations, in a file :

      • Right-click in this panel and choose the Select all option

      • Copy this selection in clipboard with the Ctrl + C shortcut ( do NOT use the context menu Copy )

      • Open a new tab ( Ctrl + N )

      • Paste the clipboard’s contents ( Ctrl + V )

      • Save this new tab

      If you need some modifications in this raw output text, just tell me ;-))

      Hope it helps you a bit !

      Best Regards,

      guy038

      1 Reply Last reply Reply Quote 4
      • M
        Márk Birtalan
        last edited by Jun 7, 2020, 5:58 PM

        Thx for the help, really appreciate it :D

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