See the gray highlighted area? I need to repeatedly delete those sections throughout the entire document, while being careful not to remove anything highlighted yellow. I'm familiar with how to add different search parameters using ( ) ^ \1-9, etc., but I'm at a loss as to how I would handle this particular project.
Any geniuses on this forum?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This deals with creating single lines from multiline sections, allowing you to easily remove those oneliners in the next pass to be left with only the lines you do want to keep.
This may hint you on an other approach: keeping (or copying) only those lines you want to (keep).
Think about what you do and do not want. What are the characteristics of both types of lines or sections?
You might want to keep only the lines starting with text (character).
You might want to remove all the lines not starting with a character a to z (A to Z).
Lines starting with {, $ and } seem to be the ones you want to remove...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the awesome information. My problem is getting a lot easier. Thing is, it's still quite painful. I'll try to be more specific - is there a way to delete everything between two symbols: { } including the symbols themselves?
Thanks again. Apparently there *are* geniuses on this forum!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can do this manually by putting the caret before or after an opening brace, and using the TextFX Quick "Mark text to matching … brace". Then you have a selection from bracket to matching bracket, which you can delete. There is also a "Mark lines to matching … braces" to select full lines, depending on what you want to achieve.
I haven't tried putting these commands in a macro, but I have my doubs on their working there.
CChris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for that tip, I feel like I'm getting closer to my solution. The catch with using that TextFX Quick trick is that I would have to do it 42,672 times. I would do a macro, but not all lines are placed the same way, so an error would be inevitable.
Some segments have different parameters (for example, not all segments like this have "$envmaptint"), so not all code between the two brackets will be the same (but ALL segments start with a { and close with a }). I have to very specifically point N++ to delete everything between the two brackets, along with the brackets themselves.
I think my solution lies with finding the perfect regular expression code specific to my need. I love Notepad++, but I think I've found its limitation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
First of all, dunno if this reply gets the correct position in the thread. SourceForge apparently doesn't want to make replying easier. I see those Add Reply and Hide Reply links flying over my screen as soon as my mouse pointer gets near them. WTF! Those people are really screwed up.
Well, I thought you could figure what to do from the SQL Comment Block case. You might not have to do very much more than replace /* and */ by { and } respectively. Perhaps you could spend some time on that… if that really is the way you want to go.
Isn't it easier to think about and perhaps describe what lines you do want to KEEP instead of removing what you do not want?
I still think you only want to keep lines starting with a character a-z or A-Z, although there are also NUL characters in your screenprint. But you might you get where you want fastest by marking all lines that you do want to keep and copying them to a new document.
Yes, there are geniuses but please do a little thinking yourself also.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've read through the examples on the "Regular Expressions" wiki page, but I can't fathom what it would take to accomplish my specific need.
I'll throw up a screen capture so you can follow along much easier:
http://yfrog.com/4rcapturehlj
See the gray highlighted area? I need to repeatedly delete those sections throughout the entire document, while being careful not to remove anything highlighted yellow. I'm familiar with how to add different search parameters using ( ) ^ \1-9, etc., but I'm at a loss as to how I would handle this particular project.
Any geniuses on this forum?
Just a quick reply.
You may find some very interesting information in the following threads:
"Does N++ Support REGEX With Multiple Lines?" (Open Discussion forum)
http://sourceforge.net/forum/forum.php?thread_id=3004512&forum_id=331753
This deals with creating single lines from multiline sections, allowing you to easily remove those oneliners in the next pass to be left with only the lines you do want to keep.
"Find - Cut the line + next one - Insert in ne" (Help forum)
http://sourceforge.net/forum/forum.php?thread_id=3086440&forum_id=331754
This may hint you on an other approach: keeping (or copying) only those lines you want to (keep).
Think about what you do and do not want. What are the characteristics of both types of lines or sections?
You might want to keep only the lines starting with text (character).
You might want to remove all the lines not starting with a character a to z (A to Z).
Lines starting with {, $ and } seem to be the ones you want to remove...
I see how sed, and probably awk would do that. But not Notepad++ I'm afraid, even with a good regex engine.
CChris
Thanks for the awesome information. My problem is getting a lot easier. Thing is, it's still quite painful. I'll try to be more specific - is there a way to delete everything between two symbols: { } including the symbols themselves?
Thanks again. Apparently there *are* geniuses on this forum!
You can do this manually by putting the caret before or after an opening brace, and using the TextFX Quick "Mark text to matching … brace". Then you have a selection from bracket to matching bracket, which you can delete. There is also a "Mark lines to matching … braces" to select full lines, depending on what you want to achieve.
I haven't tried putting these commands in a macro, but I have my doubs on their working there.
CChris
Thanks for that tip, I feel like I'm getting closer to my solution. The catch with using that TextFX Quick trick is that I would have to do it 42,672 times. I would do a macro, but not all lines are placed the same way, so an error would be inevitable.
{
$basetexture "Brick/brickwall045j"
$surfaceprop brick
$detail "detail\noise_detail_01"
$detailscale "7.740"
$detailblendfactor .8
$detailblendmode 0
$envmap env_cubemap
$basealphaenvmapmask 1
$envmapcontrast 1
$envmapsaturation 1
$envmaptint ""
}
Some segments have different parameters (for example, not all segments like this have "$envmaptint"), so not all code between the two brackets will be the same (but ALL segments start with a { and close with a }). I have to very specifically point N++ to delete everything between the two brackets, along with the brackets themselves.
I think my solution lies with finding the perfect regular expression code specific to my need. I love Notepad++, but I think I've found its limitation.
First of all, dunno if this reply gets the correct position in the thread. SourceForge apparently doesn't want to make replying easier. I see those Add Reply and Hide Reply links flying over my screen as soon as my mouse pointer gets near them. WTF! Those people are really screwed up.
Well, I thought you could figure what to do from the SQL Comment Block case. You might not have to do very much more than replace /* and */ by { and } respectively. Perhaps you could spend some time on that… if that really is the way you want to go.
Isn't it easier to think about and perhaps describe what lines you do want to KEEP instead of removing what you do not want?
I still think you only want to keep lines starting with a character a-z or A-Z, although there are also NUL characters in your screenprint. But you might you get where you want fastest by marking all lines that you do want to keep and copying them to a new document.
Yes, there are geniuses but please do a little thinking yourself also.