ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

Return of the Son of the best *free* Windows Text Editor

<< < (10/19) > >>

Jammo the OrganizedFellow:
I do tons of html/css coding.
Let's say for example, I have the following simple code:


--- ---</head>



<body>
2 html tags separated by several blank rows.

Currently, in Notepad++ (v5.7 as of this entry), I have to manually delete the few rows between those tags.
I've got dozens of pages that need this correction.
Sometimes, it's between the closing of one div tag, and the opening of another, so now I've got dozens of (what I call) GAPS inbetween my code.
No biggie, as it's just wasted space, a few bytes here and there.
But when I'm done coding a site, that's one of the last things that I do. Is remove all the unnecessary spaces, tabs, etc. to shave off some download times. Minimal, yes, but over several dozen and sometimes a hundred pages, it makes a difference.

I would have thought that doing a Find & Replace using

--- ---</head>\n\n\n<body>would work, but it doesn't.


Does anyone know of a multi-line editor (lightweight ofcourse) to assist in this little feature?
Or perhaps a plugin?

Tuxman:
Vim can.

:%s/\n\{2,}//g or something should do.

Jammo the OrganizedFellow:
Vim can.

:%s/\n\{2,}//g or something should do.
-Tuxman (November 06, 2010, 12:51 PM)
--- End quote ---
EEK!
That's scary just looking at it.

I was hoping to avoid regular expressions.

When I used to use EditPad (years ago) it had a feature that I could highlight a few rows, and hit the Find & Replace hotkey. It allows multiline ability like that. I'll check it out.
***** ***** ***** ***** *****
EDIT:
http://www.editpadlite.com/ does what I need.
I find it a little time consuming having to learn a new app just for a simple function, but it was simple.

Jibz:
I would have thought that doing a Find & Replace using

--- ---</head>\n\n\n<body>would work, but it doesn't.
-Jammo the OrganizedFellow (November 06, 2010, 12:36 PM)
--- End quote ---

I assume you have search mode set to extended to allow escapes like \n. If your file is using DOS line endings, try using \r\n instead of just \n.

Jammo the OrganizedFellow:
I assume you have search mode set to extended to allow escapes like \n. If your file is using DOS line endings, try using \r\n instead of just \n.-Jibz (November 06, 2010, 01:42 PM)
--- End quote ---
NEAT!
Thanks!

I didn't know about the \r

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version