Comment on Why does not a CR (Carriage Return) automatically start a new line on some online text editors?
schipelblorp@sh.itjust.works 1 week agoAh! Thank you for explaining it in terms of typewriters, now it’s much clearer in my mind!
The confusion still lingers. I used to cut and paste websites to print. One part of the condensation process, in addition to removing ads, was removing all the two-space line breaks of CRCR or LFLF; I still have to search for both.
historicaldocuments@lemmy.world 1 week ago
You could probably get 80% of that process done by learning some python. If you have a string “s”, then replacing double newlines with a single newline is as easy as
re.sub(“\n\n”, “\n”, s)where “\n” is an LF in many programming languages. A CR is often “\r” in the same vein. Just be aware that regular expressions can be very, very frustrating; and every webpage is going to be a new adventure in how it got formatted. If you use something like spyder it’ll allow you to see what the data looks like inside the python process so you get a chance to iterate.