• Login
Community
  • Login

Remove specific lines fron nfo's

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 3 Posters 443 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.
  • A
    Andrew Gill
    last edited by Oct 24, 2020, 7:45 PM

    Hi, new here. I’ve searched the forum, but can’t see an answer (although I may have used wrong search words).
    I have a lot of nfo files, with studios in them (example: <studio>ABC</studio>).
    Can i tell notepad, to scan only nfo’s (have other files I do not want touched), and remove any lines that start with <studio>

    Many thanks for any help you can give me

    A 2 Replies Last reply Oct 24, 2020, 8:38 PM Reply Quote 0
    • A
      Alan Kilborn @Andrew Gill
      last edited by Oct 24, 2020, 8:38 PM

      @Andrew-Gill

      I imagine you can just do a Replace in Files and specify a Filter of *.nfo. It doesn’t seem rocket science. :-)

      Change your Search mode to Regular expression and set your Find what box to (?-s)^<studio>.*\R and set the Replace with box to be empty.

      1 Reply Last reply Reply Quote 3
      • A
        Andrew Gill
        last edited by Oct 25, 2020, 8:39 AM

        Thanks. Think I had filter set wrong.
        I’ll give it a try

        1 Reply Last reply Reply Quote 0
        • A
          Andrew Gill
          last edited by Andrew Gill Oct 25, 2020, 9:14 AM Oct 25, 2020, 9:11 AM

          That didn’t work.
          I am seeing a progress bar going through all the nfo’s, but it is not removing the lines
          Not pretending to understand how this works, but is it possible that the ‘Find What’ field is searching the name of the nfo, rather than inside the nfo?

          Screenshot of notepad:
          1.PNG

          Screenshot of one of the nfo files after scan is complete:

          2.PNG

          1 Reply Last reply Reply Quote 0
          • T
            Terry R
            last edited by Oct 25, 2020, 9:19 AM

            @Andrew-Gill said in Remove specific lines fron nfo's:

            Not pretending to understand how this works,

            Your example shows the string <studio> is indented, but your search string needs it hard against the left margin.

            I’d suggest adding \h+ just after the ^. This means one or more horizontal spaces.

            Terry

            1 Reply Last reply Reply Quote 4
            • A
              Andrew Gill
              last edited by Oct 25, 2020, 9:49 AM

              @Terry-R said in Remove specific lines fron nfo's:

              \h+

              Many thanks to both of you, working great. Has saved me weeks of manual work

              1 Reply Last reply Reply Quote 0
              • T
                Terry R
                last edited by Oct 25, 2020, 10:02 AM

                @Andrew-Gill said in Remove specific lines fron nfo's:

                Many thanks to both of you, working great

                Just remember that the space character might e overlooked but with a regular expression ALL characters are equally as important.

                As a suggestion you can get Notepad++ to display these and CR and LF characters. That way you will be more cognicient of them.

                Terry

                1 Reply Last reply Reply Quote 3
                • A
                  Alan Kilborn @Andrew Gill
                  last edited by Oct 25, 2020, 11:39 AM

                  @Andrew-Gill said in Remove specific lines fron nfo's:

                  remove any lines that start with <studio>

                  I’ll just point out that your original problem statement said the above.
                  The solution I provided considered that.
                  But your real data didn’t have that condition.
                  So that’s why my solution didn’t work initially.

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