[SOLVED] Replace a file format using cli

  • Thread starter Thread starter dolo724
  • Start date Start date
D

dolo724

I have a large number of large text files I'm trying to format generally for ebook (Calibre can't do what I want), but each contains a formatting I don't know how to get around:

Quote:
This is a sentence in a
paragraph. This is the final sentence
in the paragraph.
Begin next paragraph.
I'd like to remove the LF at the end of only those lines NOT ending in a period. So if there's a period followed by a LF, the LF is not removed. The end result would look like this:

Quote:
This is a sentence in a paragraph. This is the final sentence in the paragraph.
Begin next paragraph.
I can fish around and do some things with sed and tr, but this is beyond me. I never could code, but I do okay from notes... Thanks in advance!

Continue reading...
 
Back
Top