Community
    • Login

    Remove specific lines fron nfo's

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 3 Posters 431 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.
    • Andrew GillA
      Andrew Gill
      last edited by

      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

      Alan KilbornA 2 Replies Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Andrew Gill
        last edited by

        @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
        • Andrew GillA
          Andrew Gill
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • Andrew GillA
            Andrew Gill
            last edited by Andrew Gill

            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
            • Terry RT
              Terry R
              last edited by

              @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
              • Andrew GillA
                Andrew Gill
                last edited by

                @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
                • Terry RT
                  Terry R
                  last edited by

                  @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
                  • Alan KilbornA
                    Alan Kilborn @Andrew Gill
                    last edited by

                    @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
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors