How to remove empty lines in ms-word document
Auteur du fil: Brandis (X)
Brandis (X)
Brandis (X)
Local time: 02:19
anglais vers allemand
+ ...
Sep 7, 2008

Hi! I am working on rather large project and each line represents a data entry record. The lines are not numbered so there is no problem in removing the empty lines. I have been trying out all kinds of stunts with search and replace but it is not functioning, er... ofcourse logically it will not. Doing it manually is costing too much time. Does anyone know a trick in ms-word 2003 package how I could remove the empty entries? Thank you in advance for all the helping hints. BR Brandis

[Edit
... See more
Hi! I am working on rather large project and each line represents a data entry record. The lines are not numbered so there is no problem in removing the empty lines. I have been trying out all kinds of stunts with search and replace but it is not functioning, er... ofcourse logically it will not. Doing it manually is costing too much time. Does anyone know a trick in ms-word 2003 package how I could remove the empty entries? Thank you in advance for all the helping hints. BR Brandis

[Edited at 2008-09-07 18:06]
Collapse


 
Jerzy Czopik
Jerzy Czopik  Identity Verified
Allemagne
Local time: 02:19
Membre (2003)
polonais vers allemand
+ ...
Search & Replace Sep 7, 2008

Replace double paragraph mark (ie ^p^p) through a single one (^p).
Do so as long you have empty lines.
This should do the trick

BR
Jerzy


 
Brandis (X)
Brandis (X)
Local time: 02:19
anglais vers allemand
+ ...
AUTEUR DU FIL
Thank you.. Sep 7, 2008

Jerzy Czopik wrote:

Replace double paragraph mark (ie ^p^p) through a single one (^p).
Do so as long you have empty lines.
This should do the trick

BR
Jerzy
But that does not do the trick. There are over 900,000 such entries and the empty lines come up randomly. I thought of some kind of macro or the similar that would do it. Would you know a solution there Jerzy. BR Brandis


 
Jerzy Czopik
Jerzy Czopik  Identity Verified
Allemagne
Local time: 02:19
Membre (2003)
polonais vers allemand
+ ...
I just tried this on a short document Sep 7, 2008

with some 20 lines, randomly placed empty and filled lines, sometimes double empty lines - and this works.
Just give it a try.
Maybe you need to run this S&R process more than once.


 
Daniel García
Daniel García
anglais vers espagnol
+ ...
Maybe those lines are soft breaks? Sep 7, 2008

Try Jerzy's advice but use and "L": ^L^L in case they are soft line breaks and not hard returns.

As mentioned already, you may need to repeat the search and replace several times.

Daniel


 
Samuel Murray
Samuel Murray  Identity Verified
Pays-Bas
Local time: 02:19
Membre (2006)
anglais vers afrikaans
+ ...
Don't forget about spaces... Sep 8, 2008

Brandis wrote:
Does anyone know a trick in ms-word 2003 package how I could remove the empty entries?


There may be spaces and tabs that interfere with a normal ^p^p find/replace operation. If tabs and double spaces are not required by the other entries, I suggest this:

Find: ^t
Replace: (space)

Find: (space)(space)
Replace: (space)
(and do this until the find count is 0; remember to save the document every time)

Find: ^l
Replace: ^p

Find: ^p(space)
Replace: ^p
(do this until the find count is 0)

Find: (space)^p
Replace: ^p
(do this until the find count is 0)

Find: ^p^p
Replace: ^p
(do this until you're happy with the result)



[Edited at 2008-09-08 05:05]


 
Samuel Murray
Samuel Murray  Identity Verified
Pays-Bas
Local time: 02:19
Membre (2006)
anglais vers afrikaans
+ ...
If plaintext... Sep 8, 2008

Brandis wrote:
Hi! I am working on rather large project and each line represents a data entry record.


If this is a plaintext file that was simply saved in MS Word format for convenience, I think you're better off doing the find/replace in a program that uses a smaller memory footprint than Office 2003. For plaintext files, I use Liquidninja's Metapad (not Unicode safe!). The code for paragraphs and tabs are \n and \t. Again, remember to save regularly, if your file has 900 000 entries...


 
FarkasAndras
FarkasAndras  Identity Verified
Local time: 02:19
anglais vers hongrois
+ ...
"randomly" Sep 8, 2008

Brandis wrote:

Jerzy Czopik wrote:

Replace double paragraph mark (ie ^p^p) through a single one (^p).
Do so as long you have empty lines.
This should do the trick

BR
Jerzy
But that does not do the trick. There are over 900,000 such entries and the empty lines come up randomly. I thought of some kind of macro or the similar that would do it. Would you know a solution there Jerzy. BR Brandis

It doesn't matter if they are randomly placed. Use automatic search and replace, relpace all. Hit ctrl+h to access it.

If there are multiple empty lines under each other, run a ^p^p^p^p > ^p.

If you have multiple documents with similar extra lines and spaces and whatnot, you could do a macro. Eg. remove spaces/tabs before line breaks, remove quadruple line breaks, remove double line breaks 5 times. For one doc, no need.


 
Brandis (X)
Brandis (X)
Local time: 02:19
anglais vers allemand
+ ...
AUTEUR DU FIL
Thank you Farkas.. Sep 8, 2008

FarkasAndras wrote:
That problem is not solved yet, but I have another DB in the working... uh that hurts, this time the entries are numbered, this means when the files comes in ms-word you see nothing but simple entry line. Now the problem begins with removing the numbers before the entries, such that the full entry is available at hand and..-well as always I appreciate all help remove those in-line numbers. What do we have these computers for! BR Brandis
Brandis wrote:

Jerzy Czopik wrote:

Replace double paragraph mark (ie ^p^p) through a single one (^p).
Do so as long you have empty lines.
This should do the trick

BR
Jerzy
But that does not do the trick. There are over 900,000 such entries and the empty lines come up randomly. I thought of some kind of macro or the similar that would do it. Would you know a solution there Jerzy. BR Brandis

It doesn't matter if they are randomly placed. Use automatic search and replace, relpace all. Hit ctrl+h to access it.

If there are multiple empty lines under each other, run a ^p^p^p^p > ^p.

If you have multiple documents with similar extra lines and spaces and whatnot, you could do a macro. Eg. remove spaces/tabs before line breaks, remove quadruple line breaks, remove double line breaks 5 times. For one doc, no need.


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

How to remove empty lines in ms-word document






Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »
Wordfast Pro
Translation Memory Software for Any Platform

Exclusive discount for ProZ.com users! Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value

Buy now! »