Notepad++ using find-replace function without reg. expressions??

Page 1 of 2 12 LastLast

  1. Posts : 13
    Windows 7 Ultimate x64 (SP1)
       #1

    Notepad++ using find-replace function without reg. expressions??


    I'm hoping to get lucky with this post since the forums on the official Notepad++ website are very slow to respond, and maybe someone on here uses NPP and knows the answer.

    Say I want to find a certain block of code that spans across multiple lines, and replace it with another block of code which spans across multiple lines as well.

    From what I understand, this is possible, but you have to use regular expressions, which means taking both blocks of code, and manually editing them to replace all the line breaks with regular expressions, so that they could fit into the single line input of the find-replace function.

    Needless to say this is very tedious and time consuming!!

    Is there any way that I can just select and copy-paste a block of code spanning across multiple lines, then replace it with another one which I copy-pasted as well, without having to manually edit them to replace line breaks with regular expressions??

    This was possible in CuteHTML which I was using before making the switch to Notepad++. I'm not sorry that I did as Notepad++ is far superior, but that is the only feature from CuteHTML that I miss, the ease with which you could find-replace large blocks of code just by copy pasting them.

    Any help will be greatly appreciated!

    Thanks for reading!
      My Computer


  2. Posts : 1,814
    XP / Win7 x64 Pro
       #2

    Seems pretty straight forward to me. Use "extended" mode for searching, copy the line in that you want replaced, replace the line breaks with "\r\n", then put the text in you want it replaced with and do the same.
      My Computer


  3. Posts : 13
    Windows 7 Ultimate x64 (SP1)
    Thread Starter
       #3

    FliGi7 said:
    Seems pretty straight forward to me. Use "extended" mode for searching, copy the line in that you want replaced, replace the line breaks with "\r\n", then put the text in you want it replaced with and do the same.
    Dude, this is exactly what I want to avoid doing... haven't you read my message?
      My Computer


  4. Posts : 1,814
    XP / Win7 x64 Pro
       #4

    If you could do it the way you want to, you would be able to. And as you've found out, you cannot. I don't get how adding "\r\n" to a line of text is tedious and time consuming when it will do exactly what you need done. Clearly time consumption isn't an issue as you're spending all this time of various forums trying to find a way around something you could instead just be doing and already getting done. Good luck.
      My Computer


  5. Posts : 13
    Windows 7 Ultimate x64 (SP1)
    Thread Starter
       #5

    FliGi7 said:
    If you could do it the way you want to, you would be able to. And as you've found out, you cannot. I don't get how adding "\r\n" to a line of text is tedious and time consuming when it will do exactly what you need done. Clearly time consumption isn't an issue as you're spending all this time of various forums trying to find a way around something you could instead just be doing and already getting done. Good luck.
    You don't understand how simply copying-pasting a block of code without having to manually replace all the line breaks and adding reg. expressions is easier and less time consuming?

    As for time not being an issue because I'm spending it on various forums trying to see if there's a solution to my problem, I'm actually faced with this problem a lot and so if I get a solution for it once and for all it'll save me a lot of time and effort in the future, so I figured I'd try.

    Anyway I've never understood people like you who instead of answering the question, are stating the obvious, and then trying to convince someone they were "wrong" to ask the question in the first place.

    Thanks for your opinion, but I'm looking for an answer to my question, not for people telling me I shouldn't have a problem with the thing I'm having a problem with in the first place.
      My Computer


  6. Posts : 1,814
    XP / Win7 x64 Pro
       #6

    I answered your question in my first two sentences. You can't do it the way you want to. You've already realized this. And, to follow up, I even told you exactly how you could achieve what you wanted to do. So, I'm not sure what else you're looking for. You not wanting to do something doesn't invalid the answer to a question. If you're looking to keep asking a question until you find an answer you want rather than the actual answer, this may not be the forum for you.
      My Computer


  7. Posts : 13
    Windows 7 Ultimate x64 (SP1)
    Thread Starter
       #7

    FliGi7 said:
    I answered your question in my first two sentences. You can't do it the way you want to. You've already realized this. And, to follow up, I even told you exactly how you could achieve what you wanted to do. So, I'm not sure what else you're looking for. You not wanting to do something doesn't invalid the answer to a question. If you're looking to keep asking a question until you find an answer you want rather than the actual answer, this may not be the forum for you.
    Actually Notepad++ is a pretty extensive program, many features of which I am not familiar with and don't know anything about. That's why I thought I'd ask hoping that people who are more knowledgeable than me would be able to tell me if there's an option to do what I want that I am not aware of.

    You answered by saying "If you could do it the way you want to, you would be able to.", which is a hypothetical and inconclusive statement. Rather if you'd known 100% that this wasn't possible I would expect you to write something along the lines of "There is no way to do this in Notepad++, I am an expert on the program and I can say this with 100% certainty!".

    Instead you chose to be a smartass about it, by saying it that way, and then proceeding to lecture me that I shouldn't have a problem with the issue I'm having a problem with in the first place. And now you're trying to be a smartass again by basically telling me "I told you so".

    Your attitude is that of a very condescending and irritating individual. I don't know if this is on purpose due to some real life frustrations you have, or you don't even realize you're doing this (e.g. Asperger syndrome), and this whole message of mine will now come as a complete shock to you. In any case it's surprising to me how someone with your attitude is actually a "senior member" here on the forums.

    Thanks for the great help and your "wonderful" attitude.
      My Computer


  8. Posts : 1,814
    XP / Win7 x64 Pro
       #8

    None of my answers were hypothetical, so I'm not sure you understand what that means. I'm not an expert in Notepad++ and you don't need to be to provide an answer to your question. You have an obvious problem you need to solve and Notepadd++, because it's an excellent editor, provides the means to do it. Now, for whatever reasons, you're so vehemently opposed to the answer it provides that you're instead trying to spend time attacking the person who is providing you the answer to this several times. If you want to get into psych evaluations of people, you need to understand what psychological projection is before you start accusing others of what you think they are doing. But, this is SevenForums, not PsychForums. You've been provided the answer twice now and it's obvious you have a problem with its reality. I apologize if somehow me answering your questions has offended you, and I don't want to turn you off to this great forum. But, based on your attitude thus far, it sounds like you're looking for a place someone might tell you what you want to hear rather than provide you with an answer.
      My Computer


  9. Posts : 13
    Windows 7 Ultimate x64 (SP1)
    Thread Starter
       #9

    FliGi7 said:
    None of my answers were hypothetical, so I'm not sure you understand what that means. I'm not an expert in Notepad++ and you don't need to be to provide an answer to your question. You have an obvious problem you need to solve and Notepadd++, because it's an excellent editor, provides the means to do it. Now, for whatever reasons, you're so vehemently opposed to the answer it provides that you're instead trying to spend time attacking the person who is providing you the answer to this several times. If you want to get into psych evaluations of people, you need to understand what psychological projection is before you start accusing others of what you think they are doing. But, this is SevenForums, not PsychForums. You've been provided the answer twice now and it's obvious you have a problem with its reality. I would suggest you find another place where someone might tell you what you want to hear rather than provide you with an answer.
    You provided no answer to my dilemma what so ever. If admittedly you're not an expert on Notepad++, then there might be a way to do what I want which you just don't know about, simple as that.

    You telling me with a condescending attitude what I already know and then proceeding to lecture me that I shouldn't have a problem with it is not helpful in the slightest.

    You seem to be completely lacking a sense of self awareness.

    Anyway this is getting quite ridiculous. I didn't come to this forum to start a flame war with people who have personality problems. I came here to get help with my issue.

    Is there anyone here who IS an expert on Notepad++ that can confirm with absolute certainty that what I'm looking to achieve is impossible?

    Thanks!
      My Computer


  10. Posts : 1,814
    XP / Win7 x64 Pro
       #10

    nanquan491 said:
    You provided no answer to my dilemma what so ever.
    From your original post:

    nanquan491 said:
    Is there any way that I can just select and copy-paste a block of code spanning across multiple lines, then replace it with another one which I copy-pasted as well, without having to manually edit them to replace line breaks with regular expressions??
    My second reply:

    FliGi7 said:
    If you could do it the way you want to, you would be able to. And as you've found out, you cannot.
    My third reply:

    FliGi7 said:
    You can't do it the way you want to.
    Believe it or not (which seems to be the case), those are answers to your question. Another answer is to use regular expressions, as stated in my first post, which have been specifically created for these sorts of situations. Yet another answer is to go back to your CuteHTML editor that you know already does this. So you not only have two direct answers to your question on whether or not you can do what you're looking to do in Notepad++, but you also have two possible solutions to achieve your copy/replace problem.

    You're confusing the difference between an answer, of which 2 have been provided, and a solution to your liking. No one can blame you for looking for a solution to your liking, but to say no answers have been provided is simply not reality.

    Maybe someone else can come up with another solution that you may find suitable, but I obviously cannot. I hope you get it sorted out.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 03:46.
Find Us