4 Replies - 915 Views - Last Post: 12 April 2015 - 01:30 PM

#1 solex46  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-April 15

I need help editing 500 files on Notepad ++

Posted 11 April 2015 - 01:33 PM

Hello everyone ! :)

My name is Solex, I'm European and I'm 22 yo. I would need the help of your kind and experienced community.

Indeed I'm encountering a complex issue. I'm going to schematize it so that's it's more simple for you to help me (if you have the kindness to do so of course). :)

Let's suppose I have a text file like that :

<BLA>bliblibliblibloubli</BLA><BLA>blablibliblibloubli</BLA><BLA>blibliblibliblou</BLA><BLA>bliblibloubliblibli</BLA><BLA>blablibloubloubli</BLA><BLA>bloubloubloublibloubla</BLA>


And it goes on for 500 pages...

I want that every expression that begins with "<BLA>bla" disappear, but I want to preserve every expression that begins with "<BLA>bli"... or "<BLA>blou"...
For exemple : "<BLA>blablibliblibloubli</BLA>" must go ; but <BLA>blibliblibliblou</BLA> must stay.

What I tried to do was to open Notepad++ and use the Replace tool (CTRL+H).
In the "Search" form I entered the following : "<BLA>bla(.*)</BLA>".
And I let the "Replace" form blank, because I want the corresponding instances to disappear.

Instead of just deleting the single occurences, Notepad++ targeted the maximum text range between "<BLA>bla" and "</BLA>", so that the whole text nearly vanished. And at the end, to use my first example :

<BLA>bliblibliblibloubli</BLA><BLA>blablibliblibloubli</BLA><BLA>blibliblibliblou</BLA><BLA>bliblibloubliblibli</BLA><BLA>blablibloubloubli</BLA><BLA>bloubloubloublibloubla</BLA>


TURNED INTO =>

<BLA>bliblibliblibloubli</BLA>


Do you have any idea of how I can solve that issue ? :)

Thank you very much for your time.

Best regards,
Solex46

Is This A Good Question/Topic? 0
  • +

Replies To: I need help editing 500 files on Notepad ++

#2 andrewsw  Icon User is offline

  • lashings of ginger beer
  • member icon

Reputation: 6342
  • View blog
  • Posts: 25,594
  • Joined: 12-December 12

Re: I need help editing 500 files on Notepad ++

Posted 11 April 2015 - 01:40 PM

If the text were all on one line then I would say untick the box that says "matches newline".

Otherwise, you could try <BLA>bla(.*?)</BLA> where ? is the lazy quantifier.

BTW You post suggests that you are editing a single file, with 500 pages, rather than 500 files.

This post has been edited by andrewsw: 11 April 2015 - 02:03 PM

Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is offline

  • lashings of ginger beer
  • member icon

Reputation: 6342
  • View blog
  • Posts: 25,594
  • Joined: 12-December 12

Re: I need help editing 500 files on Notepad ++

Posted 11 April 2015 - 01:46 PM

Here's a nice site a just found.

Attached Image
Was This Post Helpful? 0
  • +
  • -

#4 solex46  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 11-April 15

Re: I need help editing 500 files on Notepad ++

Posted 12 April 2015 - 08:31 AM

Hello :)

I've written "(.*?)" instead of "(.*)" and it totally works !! Thank you very much, you just saved my life :D !

Solex46
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is offline

  • lashings of ginger beer
  • member icon

Reputation: 6342
  • View blog
  • Posts: 25,594
  • Joined: 12-December 12

Re: I need help editing 500 files on Notepad ++

Posted 12 April 2015 - 01:30 PM

Cool ;)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1