NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] \n in search / replace


Joined: 05 Jul 2007
Posts: 5
Reply with quote
Some of my files have a problem where every line has a second newline after it - effectively doubling the number of lines in my code. I read in another post that this can be caused by my FTP program, and that I can set CuteFTP to binary to prevent this from happening again. Ok. I have done that, but now I'm still stuck with a huge file with an extra blank line after every line.

I tried a search and replace for \n\n with the Regular Expression checkbox checked, but it says it couldn't find \n\n. I also tried \r\r, \r\n, and \n\r, but it couldn't find those either. In fact, if I just do a search and replace for \n, it doesn't even find that - and yes, the regular expression checkbox is selected.

Can anyone tell me how I can remove those extra empty lines from my file? Thanks!
View user's profileFind all posts by DarrenSend private message


Joined: 05 Jul 2007
Posts: 5
Reply with quote
Also, when I open the file in TextPad, it does not have the extra newlines. It only appears in PhpEd for some reason.
View user's profileFind all posts by DarrenSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Quote:
I tried a search and replace for \n\n with the Regular Expression checkbox checked

As of phped version 5.2 it should work. All you need is Regular Expression and Multiline checkboxes checked.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 05 Jul 2007
Posts: 5
Reply with quote
Yes. I upgraded to 5.2 and was able to get it to work.

With multiline checked off, I had to put \n\n in the search box, and in the replace box I had to press enter once. Putting \n in the replace box would literally insert the text "\n".

Happy to have this fixed. Thanks.
View user's profileFind all posts by DarrenSend private message
[resolved] \n in search / replace
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic