Using JOE as a word processor
Hi all,
I have an old laptop which is rather slow. At the moment I'm using JOE as a word processing - I find I can be very productive with JOE, as it's very quick to run, even on my 233Mhz lump, and it doesn't offer lots of distracting buttons to press... :) JOE doesn't offer any kind of formatting, so I'd like to be able to use OpenOffice Writer on my main PC to tidy up the plain text files after I've finished with them on my laptop. However... opening a document written in JOE in OOoW reveals that JOE sticks a carriage return at the end of every line, instead of just the end of a paragraph, which would make reformatting a long document a bit of a pain. The JOE man pages mention a command line option for altering the use of carriage returns and line feeds; I've also read elsewhere about using a command line option to re-encode a plain text file to Unix/DOS/Windows format. It all seems rather confusing! Can anyone shed any light on the various encoding schemes? |
If I understand correctly, you want to replace mid-paragraph newlines with a space. If the text you want to process is in the file test.txt, try this at a bash prompt:
Code:
while read line; do [ -z "$line" ] && (echo; echo) || echo -n "$line "; done < test.txt > output.txt |
Thanks Nobber, that's spot on! The next step will be to fiddle around a bit and see if I can create an alias, so I don't have to type a string of gobbledigook every time... :)
Ta very much! |
Better than an alias would be a script:
Code:
#!/bin/sh Code:
./myscript test.txt test2.txt |
Even better! All I have to do now is come up with a name for the script... like Milford Cubicle...
* Later.... Hmmm... I pasted the above text into a new document, made it executable, and tried it out. No go. I'm not at a Linux box at the moment, so I can't confirm what the error message was... |
All times are GMT -5. The time now is 01:27 PM. |