Submitted by Vievin t3_10gwlin in LifeProTips
YabbaDabbaUngaBunga t1_j562ufz wrote
If you're doing this sort of thing frequently, learn regular expressions. Yes, the barrier to entry can be a little high for an otherwise principally non-technical person, however if text manipulation is a frequent task of yours, you'll thank yourself for having learned.
Many editors (Notepad++, etc.) support regular expressions for search-and-replace. In this case you'd simply search for \s+
(any whitespace characters) and replace them with a single space. This will convert all sequences of newlines, tabs, and spaces, to a single space.
ETA: One caveat with OP's LPT is character length limits on input fields; Chrome appears to be ~2MB, which is really, really high for most practical uses of this trick. But, if you were to copy/paste a whole PDF textbook, you could run into problems. See: https://chromium.googlesource.com/chromium/src/+/master/docs/security/url_display_guidelines/url_display_guidelines.md#URL-Length
Viewing a single comment thread. View all comments