How can I remove spaces from line breaks?

Ztak07

Power Member
Jr. VIP
Joined
Jun 23, 2012
Messages
539
Reaction score
135
I have a very big document but I have only one problem

The documents has over 1 million lines but a lot of them are empty.

They look like :

xxxxxxxx

xxxxxxx




xxxxxxxx
xxxxxxx

xxxxxxxx

I want them to look like :
xxxxxxx
xxxxxxx
xxxxxxxx
xxxxxxxx
xxxxxxxxx
xxxxxxxx

with no extra whitespace. Anyone know how to do this? Tried in excel but the file way to big
 
... Or use any good text editor and search and replace any double line-breaks with a single line-break. As it is recurring, it will remove all blank lines. NotePad2 allows you to search and replace on codes like /n/n and replace with /n. This won't work with lines with spaces on them though.
 
serch on Google "Remove Empty Lines".. Google show you good result :)
 
I'm not sure that will it be work with large file or not,

Using : Notepad
- copy all your text and paste to notepad
- at notepad, just press Ctrl+A to select all, then Alt+R to remove blank lines // this step may take a few minutes or longer for large file
- Finally, copy your text from notepad and paste back to your excel
 
Extremely easy... Go to your dreamweaver:

Press control + F which will bring up the find and replace box..

Select Find in "Current document"
Check the "Use regular expression" checkbox in Option.
In the find box type "[\r\n]{2,}" without quotes.
In the Replace box type "\n" without quotes

Click Replace All and you are done :-)

EDIT: Use notepadd++ if DW hangs..
For Notepad ++ users, press ctrl+h, select the Regular Expression checkbox and do the same...
 
If you have excel, just paste the all text to a list. Then select all lines and use "delete duplicates".
 
Won't Notepad do it? Just highlight * a * empty line whatever and use replace, just leave the replace with field empty. I do this all the time with gEdit.
 
Back
Top