Page 1 of 1

Remove Space Before Line Break

Posted: Wed Jul 25, 2012 3:14 am
by jmjf
Problem: There seems to be no way to automatically replace spaces before a line break (aka paragraph break, enter, carriage return).

So to clean up lines like:
This is a test.<space><line break>
I have to manually go to the end of every paragraph. In every text file. This situation can happen due to a slip of the keyboard or a decision to break a paragraph into two. When the characters are talking and the words are flowing, this kind of thing isn't something you think about (or want to think about).

I've tried pasting the space + line break into find/replace. That doesn't work. There doesn't seem to be a way to find non-printing characters. (I searched the manual and the forums. Saw something elsewhere on the forums that seemed to be a way to enter non-printing characters in Find/Replace, but couldn't get it to work in Scriv Win 1.2.3.)

Why this is a problem: Extra spaces artificially inflate character count, which is a critical statistic for me (more reliable than word count for estimating how much I've actually written).

Am I missing a feature somewhere?
(Maybe "space before" is called something else in British English. :) )

There is a menu item Format | Convert | Multiple Spaces to Space (Ctrl + Space). I suggest there should be either a similar menu item for Space + LineBreak OR (more generic solution) the menu item should remove all extra spaces (any space before whitespace) and be appropriately retitled.

Alternatively, a way to enter whitespace and other non-printing characters in the Find/Replace function would let me do this too (though I'd miss my old word processor macro that did everything at once). Find/Replace regular expressions or macro capabilities if you really want to thrill us techies. :wink:


Re: Remove Space Before Line Break

Posted: Fri Aug 10, 2012 6:29 pm
by klambert
I don't know how MS Word handles it, but it allows you to search for and replace special characters, most importantly tab ^t, paragraph return ^p, and manual end of line ^l This adds a huge amount of functionality to search and replace and is the one thing that has in the past pulled me back to word.

The other place where this comes up for me is I would love to be able to use these types of characters in the compile separators.

Re: Remove Space Before Line Break

Posted: Sat Aug 11, 2012 1:42 am
by jmjf
Just noticed another interesting oddness. I turned on "show invisibles" in my test file. On a line that has a space before the line break, there is no paragraph symbol at the end. If I delete the space, the paragraph symbol appears. Add the space back, it reappears. Something weird going on here. I'm only changing the space. (Not that I consider using show invisibles a viable workaround, but this was weird behavior.)

I also copied the paragraph symbol at the end of a line and pasted it into the find dialog and Scrivener was unable to find it, even though there were two in the test file. I could copy the paragraph symbol and paste it at the end of another line in the text and it worked. So that seems conclusive proof that ScrivWin 1.2.3 can copy the line break, but not find it.

I realize I'm an insane control freak, but hopefully "find and replace special characters" is in the queue for near-future enhancements. m(_ _)m

Re: Remove Space Before Line Break

Posted: Mon Jan 18, 2016 9:26 pm
by shrumpkin
I second this wanted feature. Has anything been updated regarding spaces at the end of a sentence/before a line break? The extra spaces conversion works magically; I wish I could do a project search, after completing my MS, so I don't have to go in manually with invisibles turned on in order to erase unwanted spaces at the end of a paragraph.

Thank you!

Re: Remove Space Before Line Break

Posted: Tue Feb 09, 2016 9:05 pm
by jstovell
Scrivener can already handle this for you automatically, folks. :)

In your Compile settings, go to the Transformation section and activate the "Remove trailing whitespace from documents" option. Now you can ignore it while writing and still be assured that trailing whitespace will be removed in your final document.