Removing carriage returns - OS2
This is a discussion on Removing carriage returns - OS2 ; Greetings.
I have a number of rather large text files that have been formatted for
a low resolution, so they all have carriage returns half way across the
line.
Is there anyway that I can remove those so the page ...
-
Removing carriage returns
Greetings.
I have a number of rather large text files that have been formatted for
a low resolution, so they all have carriage returns half way across the
line.
Is there anyway that I can remove those so the page can auto-wrap, thus
auto-adjusting to the path width?
Thank-you
--
__________________________________________________ ___________________
_____
- = B e n D r a g o n = - ____
____ B_DragonKNOT@KNOTsf-w.net
_____
__________________________________________________ ___________________
**Puzzled? Undo the "Knot"(s) to reveal the E-Mail address.
-
Re: Removing carriage returns
Ben Dragon writes:
> I have a number of rather large text files that have been formatted for
> a low resolution, so they all have carriage returns half way across the
> line.
>
> Is there anyway that I can remove those so the page can auto-wrap, thus
It's a rather simple program to read a text file and remove all the
carriage return and line feed characters. However, if you want to
preserve them at the end of paragraphs, for example, then you need
more sophisticated logic.
-
Re: Removing carriage returns
tholen@antispam.ham wrote:
> Ben Dragon writes:
>
>
>>I have a number of rather large text files that have been formatted for
>>a low resolution, so they all have carriage returns half way across the
>>line.
>>
>>Is there anyway that I can remove those so the page can auto-wrap, thus
>
>
> It's a rather simple program to read a text file and remove all the
> carriage return and line feed characters. However, if you want to
> preserve them at the end of paragraphs, for example, then you need
> more sophisticated logic.
>
Usually carriage returns in the middle of a line is to permit
overprinting or alignment of columns. Removing them may create other
problems.
The ASCII control code for a carriage return is (decimal)'13'.
The ASCII control code for a Line Feed is (decimal) '10'
You can use OS/S enhanced editor search & replace function to edit the
files. Open the Enhanced editor (from an os/2 window the editor is
invoked by entering "epm" without the quotes.
Open the file to be edited. I would suggest that you immediately use
the "save as" function to change the name of the working file and
preserve the original file in case of problems.
Click on the "search function" icon. To enter a control code such as
decimal '13', hold down the [alt] key and use the numeric keypad to
enter '013' (without the quote). When you release the [alt] key a
musical note should appear in the 'search for" window. Tab to the
"replace" window and enter a single space.
You can then use the find and replace funtions to find all instances of
the carriage return and replace them with spaces.
When completed, you may have to then manually reinsert "end of paragraph
codes to force double line spacing between paragraphs.
--
Jack Wise
Secretary, Oak Wood Lodge No. 1444, AF & AM, The Woodlands, TX
(www.txmason.com) ( Lodge E-Mail: oakwood1444@hal-pc.org )
PM, Jacques DeMolay Lodge No. 1390, AF & AM, Houston, TX
( www.jd1390.org/jdmlodge.htm )
TEXAS red wine: renowned for its smoky-mesquite-bbq & jalapeno
overtones, the perfect foil for a meal of tacos and refried beans...
-
Re: Removing carriage returns
Ben Dragon wrote:
>
> I have a number of rather large text files that have been formatted for
> a low resolution, so they all have carriage returns half way across the
> line.
>
> Is there anyway that I can remove those so the page can auto-wrap, thus
> auto-adjusting to the path width?
>
Some word processors import text files offering the options to read them
"as is," as "DOS text" files retaining the newlines, or as "generic
[Windows] text" which removes the in-paragraph newlines but keeps the
paragraphs separated.
--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
-
Re: Removing carriage returns
Jack Wise writes:
>> Ben Dragon wrote:
>>> I have a number of rather large text files that have been formatted for
>>> a low resolution, so they all have carriage returns half way across the
>>> line.
>>>
>>> Is there anyway that I can remove those so the page can auto-wrap, thus
>> It's a rather simple program to read a text file and remove all the
>> carriage return and line feed characters. However, if you want to
>> preserve them at the end of paragraphs, for example, then you need
>> more sophisticated logic.
> Usually carriage returns in the middle of a line is to permit
> overprinting or alignment of columns. Removing them may create other
> problems.
I'll leave that for the original poster to decide.
-
Re: Removing carriage returns
In article
B_Dragon@self-wrighting.net "Ben Dragon" writes:
> I have a number of rather large text files that have been formatted for
> a low resolution, so they all have carriage returns half way across the
> line.
>
> Is there anyway that I can remove those so the page can auto-wrap, thus
> auto-adjusting to the path width?
I suspect this suggestion will ignored completely as usual. FWIW
here goes...
Way back, I produced an ASCII toolkit, called XTABS (for historic
reasons). Being a DOS app, it will require an OS/2 VDOS session.
One of its (many) functions is to recognise paragraphs and remove
all CR/LF/CRLF/LFCR codes at line-ends except at para end: see /p
command.
Paras are defined as starting after any blank line or at any line
that starts with an indent. That may not be perfect but has done
a bang-up job on huge ASCII files I've thrown at it.
ISTR I put a copy on the Demon FTP site. Try directory
ftp://ftp.demon.co.uk/pub/ibmpc/dos/apps/utils/
then look for a ZIP file beginning XTABS.
--
Andrew Stephenson
-
Re: Removing carriage returns
On Mon, 2 Jul 2007 16:33:15 UTC, "Ben Dragon"
wrote:
> I have a number of rather large text files that have been formatted for
> a low resolution, so they all have carriage returns half way across the
> line.
>
> Is there anyway that I can remove those so the page can auto-wrap, thus
> auto-adjusting to the path width?
I'd like to clarify what I think you are saying. You have a file, from
which you want to remove all carriage return/line feeds EXCEPT at the
end of paragraphs (i.e. leave those that are adjacent multiples of
CR-LF).
Or, are you saying that you want to remove every alternate CR-LF?
The first is really trivial using a macro processor such as ML/I, and
three short lines of macros. I can post the instructions here (ML/I
takes less than a minute to download and install, being a single
executable file).
--
Bob Eager
-
Re: Removing carriage returns
On 02.07.07 18:33, Ben Dragon wrote:
> I have a number of rather large text files that have been formatted
> for a low resolution, so they all have carriage returns half way
> across the line.
>
> Is there anyway that I can remove those so the page can auto-wrap,
> thus auto-adjusting to the path width?
Larry Margolis had written an EPM macro for preparing a text
containing lineends for loading into a word processor: WORDPROC.E. It
can be found somewhere in an 10 years old thread on c.o.o.apps. The
recent CVS version of NEPMD has that file included. If you want me to
mail it to you or need other help, let me know. (You have a valid
email address from me.)
The macro works well and you can also do the reverse thing wis EPM,
of course.
--
Andreas Schnellbacher
-
Re: Removing carriage returns
On Tue, 3 Jul 2007 06:35:12 UTC, "Bob Eager" wrote:
> On Mon, 2 Jul 2007 16:33:15 UTC, "Ben Dragon"
> wrote:
>
> > I have a number of rather large text files that have been formatted for
> > a low resolution, so they all have carriage returns half way across the
> > line.
> >
> > Is there anyway that I can remove those so the page can auto-wrap, thus
> > auto-adjusting to the path width?
>
> I'd like to clarify what I think you are saying. You have a file, from
> which you want to remove all carriage return/line feeds EXCEPT at the
> end of paragraphs (i.e. leave those that are adjacent multiples of
> CR-LF).
>
> Or, are you saying that you want to remove every alternate CR-LF?
>
> The first is really trivial using a macro processor such as ML/I, and
> three short lines of macros. I can post the instructions here (ML/I
> takes less than a minute to download and install, being a single
> executable file).
Essentially, I just want to auto line wrap, (Ctl-W in most text
editors), to be able to work.
Right now, on some particular old documents I have, a carriage return
forces a premature line shortening.
It would take me forever to remove them manually as some of these
documents are very long.
Also, I _do_ want to retain paragraphs.
I do _not_ want every alternate CR-LF removed.
Thanks for replying, Bob.
--
__________________________________________________ ___________________
_____
- = B e n D r a g o n = - ____
____ B_DragonKNOT@KNOTsf-w.net
_____
__________________________________________________ ___________________
**Puzzled? Undo the "Knot"(s) to reveal the E-Mail address.
-
Re: Removing carriage returns
On Tue, 3 Jul 2007 00:17:24 UTC, ames@deltrak.demon.co.uk (Andrew
Stephenson) wrote:
> I suspect this suggestion will ignored completely as usual. FWIW
> here goes...
Not by me.
> Way back, I produced an ASCII toolkit, called XTABS (for historic
> reasons). Being a DOS app, it will require an OS/2 VDOS session.
> One of its (many) functions is to recognise paragraphs and remove
> all CR/LF/CRLF/LFCR codes at line-ends except at para end: see /p
> command.
>
> Paras are defined as starting after any blank line or at any line
> that starts with an indent. That may not be perfect but has done
> a bang-up job on huge ASCII files I've thrown at it.
>
> ISTR I put a copy on the Demon FTP site. Try directory
> ftp://ftp.demon.co.uk/pub/ibmpc/dos/apps/utils/
> then look for a ZIP file beginning XTABS.
Greetings, Andrew.
I'll give that a try.
Thanks.
BTW, the URL that you gave me is password protected. 8\
--
__________________________________________________ ___________________
_____
- = B e n D r a g o n = - ____
____ B_DragonKNOT@KNOTsf-w.net
_____
__________________________________________________ ___________________
**Puzzled? Undo the "Knot"(s) to reveal the E-Mail address.
-
Re: Removing carriage returns
On Tue, 3 Jul 2007 17:29:31 UTC, Andreas Schnellbacher
wrote:
> On 02.07.07 18:33, Ben Dragon wrote:
>
> > I have a number of rather large text files that have been formatted
> > for a low resolution, so they all have carriage returns half way
> > across the line.
> >
> > Is there anyway that I can remove those so the page can auto-wrap,
> > thus auto-adjusting to the path width?
>
> Larry Margolis had written an EPM macro for preparing a text
> containing lineends for loading into a word processor: WORDPROC.E. It
> can be found somewhere in an 10 years old thread on c.o.o.apps. The
> recent CVS version of NEPMD has that file included. If you want me to
> mail it to you or need other help, let me know. (You have a valid
> email address from me.)
>
> The macro works well and you can also do the reverse thing wis EPM,
> of course.
Greetings again, Andreas.
I'd like that.
Check your E-mail.
8)
--
__________________________________________________ ___________________
_____
- = B e n D r a g o n = - ____
____ B_DragonKNOT@KNOTsf-w.net
_____
__________________________________________________ ___________________
**Puzzled? Undo the "Knot"(s) to reveal the E-Mail address.
-
Re: Removing carriage returns
In article
B_Dragon@self-wrighting.net "Ben Dragon" writes:
> On Tue, 3 Jul 2007 00:17:24 UTC, ames@deltrak.demon.co.uk (Andrew
> Stephenson) wrote:
>
> > I suspect this suggestion will ignored completely as usual. FWIW
> > here goes...
>
> Not by me.
Thank you, sir. You are (well, seem to be ) a gentleman.
> > Way back, I produced an ASCII toolkit, called XTABS (for historic
> > reasons). Being a DOS app, it will require an OS/2 VDOS session.
> > One of its (many) functions is to recognise paragraphs and remove
> > all CR/LF/CRLF/LFCR codes at line-ends except at para end: see /p
> > command.
> >
> > Paras are defined as starting after any blank line or at any line
> > that starts with an indent. That may not be perfect but has done
> > a bang-up job on huge ASCII files I've thrown at it.
> >
> > ISTR I put a copy on the Demon FTP site. Try directory
> > ftp://ftp.demon.co.uk/pub/ibmpc/dos/apps/utils/
> > then look for a ZIP file beginning XTABS.
>
> Greetings, Andrew.
>
> I'll give that a try.
>
> Thanks.
>
> BTW, the URL that you gave me is password protected. 8\
(Baffled.) But only mildly, last time I checked. Try the usual
"Anonymous" login procedure. The site prompts you for entries.
You may have to approach it using OS/2's FTP app. In the below,
quotes delimit example commands and should not actually be used.
* Run the dialler and connect to Net via your ISP.
* Go to an OS/2 command line and enter (mind the gap):
ftp ftp.demon.co.uk
* You should be challenged by Demon's FTP server for ID.
* Navigate using "cd " to the directory. Eg:
cd /pub/ibmpc/dos/apps/utils
* Optionally, check for file in the directory with "ls" (or IIRC
"dir").
* Switch to "binary".
* "get "
* Once you have the file, "quit".
(If that was me teaching Granny how to suck eggs, my apologies.
It felt quicker to write it all out in one psting. If anyone's
spotted a mistake, please comment. How many people use FTP
these days, that way, I wonder?)
--
Andrew Stephenson
-
Re: Removing carriage returns
Sir:
Andrew Stephenson wrote:
>> BTW, the URL that you gave me is password protected. 8\
>
> (Baffled.) But only mildly, last time I checked. Try the usual
> "Anonymous" login procedure. The site prompts you for entries.
>
> You may have to approach it using OS/2's FTP app. In the below,
> quotes delimit example commands and should not actually be used.
>
> * Run the dialler and connect to Net via your ISP.
>
> * Go to an OS/2 command line and enter (mind the gap):
> ftp ftp.demon.co.uk
>
> * You should be challenged by Demon's FTP server for ID.
>
> * Navigate using "cd " to the directory. Eg:
> cd /pub/ibmpc/dos/apps/utils
>
> * Optionally, check for file in the directory with "ls" (or IIRC
> "dir").
>
> * Switch to "binary".
>
> * "get "
>
> * Once you have the file, "quit".
>
> (If that was me teaching Granny how to suck eggs, my apologies.
> It felt quicker to write it all out in one psting. If anyone's
> spotted a mistake, please comment. How many people use FTP
> these days, that way, I wonder?)
Thanks, SeaMonkey fetched the directory with no problem here.
--
Bill
Thanks a Million!
-
Re: Removing carriage returns
On Tue, 3 Jul 2007 21:04:11 UTC, "Ben Dragon"
wrote:
> On Tue, 3 Jul 2007 06:35:12 UTC, "Bob Eager" wrote:
>
> > On Mon, 2 Jul 2007 16:33:15 UTC, "Ben Dragon"
> > wrote:
> >
> > > I have a number of rather large text files that have been formatted for
> > > a low resolution, so they all have carriage returns half way across the
> > > line.
> > >
> > > Is there anyway that I can remove those so the page can auto-wrap, thus
> > > auto-adjusting to the path width?
> >
> > I'd like to clarify what I think you are saying. You have a file, from
> > which you want to remove all carriage return/line feeds EXCEPT at the
> > end of paragraphs (i.e. leave those that are adjacent multiples of
> > CR-LF).
> >
> > Or, are you saying that you want to remove every alternate CR-LF?
> >
> > The first is really trivial using a macro processor such as ML/I, and
> > three short lines of macros. I can post the instructions here (ML/I
> > takes less than a minute to download and install, being a single
> > executable file).
>
> Essentially, I just want to auto line wrap, (Ctl-W in most text
> editors), to be able to work.
>
> Right now, on some particular old documents I have, a carriage return
> forces a premature line shortening.
>
> It would take me forever to remove them manually as some of these
> documents are very long.
>
> Also, I _do_ want to retain paragraphs.
>
> I do _not_ want every alternate CR-LF removed.
You need to define what determines the end of a paragraph, then, as in
the first scenario I asked about. Is it a pair of CRLFs, or what? If so,
that's really trivial, as I said. Just convert single CRLF to a space
(unless preceded or followed by one), and leave multiple adjacent ones
alone. Would that be an accurate description of the problem?
--
Bob Eager
-
Re: Removing carriage returns
On Tue, 3 Jul 2007 22:38:47 UTC, ames@deltrak.demon.co.uk (Andrew
Stephenson) wrote:
> >
> > BTW, the URL that you gave me is password protected. 8\
>
> (Baffled.) But only mildly, last time I checked. Try the usual
> "Anonymous" login procedure. The site prompts you for entries.
>
> You may have to approach it using OS/2's FTP app. In the below,
> quotes delimit example commands and should not actually be used.
>
> * Run the dialler and connect to Net via your ISP.
>
> * Go to an OS/2 command line and enter (mind the gap):
> ftp ftp.demon.co.uk
>
> * You should be challenged by Demon's FTP server for ID.
>
> * Navigate using "cd " to the directory. Eg:
> cd /pub/ibmpc/dos/apps/utils
>
> * Optionally, check for file in the directory with "ls" (or IIRC
> "dir").
>
> * Switch to "binary".
>
> * "get "
>
> * Once you have the file, "quit".
>
> (If that was me teaching Granny how to suck eggs, my apologies.
> It felt quicker to write it all out in one psting. If anyone's
> spotted a mistake, please comment. How many people use FTP
> these days, that way, I wonder?)
Worked OK this time.
I'll give it a try.
Tnx.
--
__________________________________________________ ___________________
_____
- = B e n D r a g o n = - ____
____ B_DragonKNOT@KNOTsf-w.net
_____
__________________________________________________ ___________________
**Puzzled? Undo the "Knot"(s) to reveal the E-Mail address.
-
Re: Removing carriage returns
In article
B_Dragon@self-wrighting.net "Ben Dragon" writes:
> Worked OK this time.
Splendid.
> I'll give it a try.
Life keeps on getting better. :-)
--
Andrew Stephenson
-
Re: Removing carriage returns
On Tue, 3 Jul 2007 21:04:11 UTC, "Ben Dragon"
wrote:
> Essentially, I just want to auto line wrap, (Ctl-W in most text
> editors), to be able to work.
Use NEPMD.
Step one: set the marins you likes for the document.
Step 2: use the reflow function to get the whole document reflowd to
the marins you've set.
done.
You can download the most current version for free from
--
Tschau/Bye
Herbert
Visit http://www.ecomstation.de the home of german eComStation
eComStation 1.2R Deutsch ist da!
-
Re: Removing carriage returns
In , on
07/02/2007
at 04:33 PM, "Ben Dragon"
said:
>I have a number of rather large text files that have been formatted
>for a low resolution, so they all have carriage returns half way
>across the line.
ITYM CRLF, not just CR.
>Is there anyway that I can remove those so the page can auto-wrap,
>thus auto-adjusting to the path width?
Change '0A0D' to space except where you want a new line. Or use the
wrap function of a word processor, then save as text.
>Is there anyway that I can remove those so the page can auto-wrap,
>thus auto-adjusting to the path width?
I'm not sure what you mean by that last.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org