How to remove empty lines in ms-word document
Thread poster: Brandis (X)
Brandis (X)
Brandis (X)
Local time: 16:37
English to German
+ ...
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
Germany
Local time: 16:37
Member (2003)
Polish to German
+ ...
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: 16:37
English to German
+ ...
TOPIC STARTER
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
Germany
Local time: 16:37
Member (2003)
Polish to German
+ ...
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
English to Spanish
+ ...
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
Netherlands
Local time: 16:37
Member (2006)
English to 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
Netherlands
Local time: 16:37
Member (2006)
English to 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: 16:37
English to Hungarian
+ ...
"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: 16:37
English to German
+ ...
TOPIC STARTER
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 Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

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! »