Mobile menu

How to remove empty lines in ms-word document
Thread poster: xxxBrandis
xxxBrandis
Local time: 11:39
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

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


Direct link Reply with quote
 

Jerzy Czopik  Identity Verified
Germany
Local time: 11:39
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


Direct link Reply with quote
 
xxxBrandis
Local time: 11:39
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


Direct link Reply with quote
 

Jerzy Czopik  Identity Verified
Germany
Local time: 11:39
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.


Direct link Reply with quote
 
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


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 11:39
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]


Direct link Reply with quote
 

Samuel Murray  Identity Verified
Netherlands
Local time: 11:39
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...


Direct link Reply with quote
 
FarkasAndras
Local time: 11:39
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.


Direct link Reply with quote
 
xxxBrandis
Local time: 11:39
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.


Direct link Reply with quote
 


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

Advanced search






WordFinder
The words you want Anywhere, Anytime

WordFinder is the market's fastest and easiest way of finding the right word, term, translation or synonym in one or more dictionaries. In our assortment you can choose among more than 120 dictionaries in 15 languages from leading publishers.

More info »
Across v6.3
Translation Toolkit and Sales Potential under One Roof

Apart from features that enable you to translate more efficiently, the new Across Translator Edition v6.3 comprises your crossMarket membership. The new online network for Across users assists you in exploring new sales potential and generating revenue.

More info »



All of ProZ.com
  • All of ProZ.com
  • Term search
  • Jobs