Erasing blank lines
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Erasing blank lines
Hi, I like the EditDelLine command, but is there a similar command to erase all the blank lines of the active document?
Also, is there a simple command to erase all white spaces in the end of lines? This is because sometimes I paste a list in a txt file, but the source had one or a couple of blank spaces at the end of each line.
Thanks in advance!
Also, is there a simple command to erase all white spaces in the end of lines? This is because sometimes I paste a list in a txt file, but the source had one or a couple of blank spaces at the end of each line.
Thanks in advance!
1.) replace by (Regex!) repeatedly till it finds no more.
2.) there is an option to strip trailing whitespace on saving. You can set this per document class, go to Configure - Preferences - Document Classes - <yourdocumentclass>, then in the righthand side of the dialog search for the checkbox "Strip trailing spaces from lines when saving".
Code: Select all
\n\n
Code: Select all
\n
2.) there is an option to strip trailing whitespace on saving. You can set this per document class, go to Configure - Preferences - Document Classes - <yourdocumentclass>, then in the righthand side of the dialog search for the checkbox "Strip trailing spaces from lines when saving".
Could not find such Regular Expression! A piece of the text I was trying to apply was:
Thanks!!
Code: Select all
4 Standstill
2 Umezawa's Jitte
// 29 other spells
// Sideboard
SB: 3 Annul
SB: 1 Blue Elemental Blast
SB: 3 Engineered
PostPosted: Mon Dec 29, 2008 7:20 am Post subject:
1.) replace
Code:
\n\n
by
Code:
\n
(Regex!) repeatedly till it finds no more.
2.) there is an option to strip trailing whitespace on saving. You can set this per document class, go to Configure - Preferences - Document Classes - <yourdocumentclass>, then in the righthand side of the dialog search for the checkbox "Strip trailing spaces from lines when saving".
Thanks!!
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
To replace all trailing spaces at the end of line:
Search for: _*\n
Replace with: \n
( Using "_" to represent the space character )
---------------------------
To replace all blank liines:
Search for: \n\n
Replace with: \n
===========================================
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Search for: _*\n
Replace with: \n
( Using "_" to represent the space character )
---------------------------
To replace all blank liines:
Search for: \n\n
Replace with: \n
===========================================
Use the following settings:
-----------------------------------------
[X] Regular expression
Replace All
-----------------------------------------
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-----------------------------------------
Hope this was helpful.............good luck,
Bob
Bob
- Bob Hansen
- Posts: 1516
- Joined: Sun Mar 02, 2003 8:15 pm
- Location: Salem, NH
- Contact:
Maybe the blank lines are not blank?
Have you turned on visibility for all characters? Maybe spaces or tabs are there?
Have you tried to remove trailing spaces on the "blank lines" first? Remove the blank spaces on all lines, then try searching for \n\n. And make sure there are no leading/trailing spaces in the search phrase \n\n.
Have you turned on visibility for all characters? Maybe spaces or tabs are there?
Have you tried to remove trailing spaces on the "blank lines" first? Remove the blank spaces on all lines, then try searching for \n\n. And make sure there are no leading/trailing spaces in the search phrase \n\n.
Hope this was helpful.............good luck,
Bob
Bob
Hmm, that's it! There are actually tab spaces! But they aren't visible, so is there another trick to get get rid of all blank lines, including the ones with white spaces or tabs?Bob Hansen wrote:Maybe the blank lines are not blank?
Have you turned on visibility for all characters? Maybe spaces or tabs are there?
Have you tried to remove trailing spaces on the "blank lines" first? Remove the blank spaces on all lines, then try searching for \n\n. And make sure there are no leading/trailing spaces in the search phrase \n\n.
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm