Re: Eliminating .txt file hard returns

Subject: Re: Eliminating .txt file hard returns
From: GhostWolf <ghstwolf -at- SLIP -dot- NET>
Date: Wed, 21 Oct 1998 13:00:31 -0700

Hi, Gary;

You wrote:
>A colleague of mine downloaded an important reference document from the
>Internet. This document arrived as a .txt file containing hundreds (at
>least) superfluous hard returns. Currently the document is 555 pages
>long. We figure it is actually about a third of that length without the
>extra returns. Does anyone have any suggestions of how to automatically
>remove these returns? To remove them manually could take years and cost
>thousands of lives.

I run into this consistently because I port documentation, text, and
HTML between UNIX (Solaris) and WinTel systems.

If you have access to vi:

1. open the file with vi - usually "vi filename" - though there are
some GUI-based versions of vi around; the one I use is called
"vim", and runs under Win95/Win98 - I don't have the website
for download readily available here from work, email me and I can
either send you the URL, or make the zip file available via ftp.

2. Enter command mode by pressing the colon; at the bottom of the
screen you will see the ":" appear.

3. Enter:

:g/^M/s///g <return>

The "^M" is the MS hard-return character, and is entered by
holding <ctrl> and <v> at the same time, and while holding them,
pressing <return>

4. Save the file:

Enter command mode again (Press the colon) and enter <wq> (write,
quit):

:wq

I know that emacs also has the capability of eliminating control codes,
but I'm not familiar with emacs.

Some word processing packages have the ability to save text in MS or
UNIX format; i.e. MS format is <line-feed/return> where UNIX format
is <line-feed> only.

I may have that last part backwards though 8*P

Hope this helps!

GhostWolf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ghstwolf -at- slip -dot- net http://www.nemasys.com/ghostwolf/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Childhood is that state which ends the moment a puddle is first viewed

>A search of the Techwr-l archives didn't prove helpful. I tried
>everything suggested without success. All suggestions are appreciated.
>
>Regards,
>
>Gary G. Robinson, Technical Writer
>COM, Inc. An Enprotech Company
>7300 W. Huron River Drive
>Dexter, MI 48130
>734-426-7000 x20 734-426-7004 fax
>robinson -at- cominc -dot- com
>
>Usual disclaimers apply
>
>From ??? -at- ??? Sun Jan 00 00:00:00 0000==
>
>
>
>

>A search of the Techwr-l archives didn't prove helpful. I tried
>everything suggested without success. All suggestions are appreciated.
>
>Regards,
>
>Gary G. Robinson, Technical Writer
>COM, Inc. An Enprotech Company
>7300 W. Huron River Drive
>Dexter, MI 48130
>734-426-7000 x20 734-426-7004 fax
>robinson -at- cominc -dot- com
>
>Usual disclaimers apply
>
>From ??? -at- ??? Sun Jan 00 00:00:00 0000==
>
>
>
>
as an obstacle instead of an opportunity.

Kathy Williams - May 5, 1995

From ??? -at- ??? Sun Jan 00 00:00:00 0000=




Previous by Author: Tech Writer 2/3 Opening
Next by Author: Questions for doc managers
Previous by Thread: Re: Eliminating .txt file hard returns
Next by Thread: Re: Eliminating .txt file hard returns


What this post helpful? Share it with friends and colleagues:


Sponsored Ads