LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-17-2005, 08:27 AM   #1
erraticassassin
Member
 
Registered: Feb 2004
Distribution: Slackware 13.1
Posts: 131

Rep: Reputation: 18
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?
 
Old 03-17-2005, 11:13 AM   #2
Nobber
Member
 
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265

Rep: Reputation: 30
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
and then have a look at the contents of output.txt. I tried this on a very simple input file and it seemed to do what you're after.
 
Old 03-18-2005, 03:17 AM   #3
erraticassassin
Member
 
Registered: Feb 2004
Distribution: Slackware 13.1
Posts: 131

Original Poster
Rep: Reputation: 18
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!
 
Old 03-19-2005, 06:31 AM   #4
Nobber
Member
 
Registered: Jun 2002
Location: Nova Scotia
Distribution: Debian (home), Kubuntu 7.04 (work)
Posts: 265

Rep: Reputation: 30
Better than an alias would be a script:

Code:
#!/bin/sh
while read line; do
  [ -z "$line" ] && (echo; echo) || echo -n "$line "
done < $1 > ${2:-output.txt}
Save that in a file called "myscript" (for example) and make it executable (chmod 755 myscript). Then to process the file "test.txt" and shove the output into "test2.txt", do:

Code:
./myscript test.txt test2.txt
(If you don't give an output file name, the script will default to using "output.txt".)
 
Old 03-19-2005, 03:53 PM   #5
erraticassassin
Member
 
Registered: Feb 2004
Distribution: Slackware 13.1
Posts: 131

Original Poster
Rep: Reputation: 18
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...

Last edited by erraticassassin; 03-21-2005 at 08:32 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it the word processor or printer? anders_ant Linux - Software 1 09-22-2004 10:51 PM
recommend a word processor! carboncopy Slackware 13 08-14-2003 11:31 AM
Best word processor? kdaru Linux - Software 14 06-11-2002 08:00 AM
Word processor msammer Linux - Newbie 2 01-29-2002 06:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration