How to remove all lines before the first : if there are 2 :'s in the file?
-
Example:
hello:pig:cake
I would like to remove the hello from all the lines
-
Have you tried to create an expression yet? In Ñotepad++ you can use a normal replace using that word, in the replace field you would have nothing. In effect you are deleting that word.
I do wonder though, given the title of your question, the content differs from that so maybe you meant to ask something else?
Terry
-
Your subject line and the example are not specific enough, and possibly contradict each other:
The subject says you want to remove all lines before the first
:
in the file if there are two:
s in the file. That would say thatfirst line second line hello : second : here
would become
hello : second : here
But your example doesn’t seem to agree.
Based on your example, I assume you want something like:
hello:pig:cake hello;pig;cake -- note, this line is semicolons, not colons hello:pig:cake
to become
:pig:cake hello;pig;cake -- note, this line is semicolons, not colons :pig:cake
Could you please give a bigger example document, showing us both the before and after? (To include your text verbatim, as I have, prefix every line in the text by 4 spaces, with a blank line before and after)
Also, show what you tried.
this faq will give you a good start on regular expressions.
If you give a fuller explanation of what you want, and some indication that you’re willing to put in effort and learn, you’ll probably get one or more answers in short order. (Though it’s the weekend, so “short order” might be Monday. Ahh, @Terry-R showed up, so you might even get it sooner. Depends on who’s around when you clarify things.)