TextExpander: Merge Text to a Single Line19 Dec 2016
It’s the little things that really irritate me. I’ve just got one of those personalities I guess. I can’t help myself - if there’s an itch I always have to find a way to scratch it. One of these itches for me is copying and pasting text out of PDFs and getting unwanted line breaks in the resulting plain text. I decided to address this irritation with a little bit of text manipulation.
Whilst the text may be continuous originally when formatting the text for layout in a PDF hard line breaks often seem to be added and whilst my approach is not perfect it scratches enough of the itch for me to make it more bearable. The basic assumption on my part is that I don’t want any line breaks in the text being pasted or at the very least it will be mush less effort to add a handful of desired line breaks back in rather than take a large number of line breaks out.
My tool of choice for this is Smile Software’s TextExpander. This is a text tool typically used for auto correction and insertion of boilerplate text. However TextExpander is much more powerful than that when you combine it with some of its scripting functionality.
|Label||Merge to One Line [Clipboard]|
|Description||Take multiple lines of text on the clipboard and merge to a single line.|
You may need to select, copy and paste the snippet lines above to view them properly as they are fairly long.