Re: Remove escape characters from file

2007-10-29 Thread Brett Lymn
On Fri, Oct 26, 2007 at 03:45:39PM +0200, Pieter Verberne wrote:
 
 does OpenBSD have a program/script to remove control characters (escape
 sequence) from text files?
 

Try col -b

-- 
Brett Lymn
Warning:
The information contained in this email and any attached files is
confidential to BAE Systems Australia. If you are not the intended
recipient, any use, disclosure or copying of this email or any
attachments is expressly prohibited.  If you have received this email
in error, please notify us immediately. VIRUS: Every care has been
taken to ensure this email and its attachments are virus free,
however, any loss or damage incurred in using this email is not the
sender's responsibility.  It is your responsibility to ensure virus
checks are completed before installing any data sent in this email to
your computer.



Remove escape characters from file

2007-10-26 Thread Pieter Verberne
Hi,

does OpenBSD have a program/script to remove control characters (escape
sequence) from text files?

Pieter



Re: Remove escape characters from file

2007-10-26 Thread Calomel
Pieter,

To remove the ^M characters at the end of all lines in vi, use:

:%s/^V^M//g

The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this,
it will look like this:

:%s/^M//g

--
 Calomel @ http://calomel.org
 Open Source Research and Reference

On Fri, Oct 26, 2007 at 03:45:39PM +0200, Pieter Verberne wrote:
Hi,

does OpenBSD have a program/script to remove control characters (escape
sequence) from text files?

Pieter



Re: Remove escape characters from file

2007-10-26 Thread Andreas Maus
On Fri, Oct 26, 2007 at 03:45:39PM +0200, Pieter Verberne wrote:
 Hi,
Hi Pieter.

 does OpenBSD have a program/script to remove control characters (escape
 sequence) from text files?
Do you mean something like the ^M (\r) character ?
I recommend using tr, e.g.:

tr -d '\r'  name_of_inputfile  name_of_outputfile

HTH,

Andreas.

-- 
Windows 95: A 32-bit patch for a 16-bit GUI shell running on top of
an 8-bit operating system written for a 4-bit processor by a 2-bit
company who cannot stand 1 bit of competition.



Re: Remove escape characters from file

2007-10-26 Thread djgoku
On 10/26/07, Pieter Verberne [EMAIL PROTECTED] wrote:
 Hi,

 does OpenBSD have a program/script to remove control characters (escape
 sequence) from text files?

Not sure if this is what you are wanting.

tr '\r' '\n'  inputfile  outputfile

more info @ http://en.wikipedia.org/wiki/Newline



Re: Remove escape characters from file

2007-10-26 Thread Ingo Schwarze
Hi Peter,

 does OpenBSD have a program/script to remove control characters (escape
 sequence) from text files?

Sure,
  sed 's/[^A-Z ]//g'

No kidding: Usually you want to specify which characters to allow,
not which characters to remove (default deny policy).
In case you want to allow more than just capital letters and blanks,
add them to the character set above.  See sed(1) for details.

Yours,
  Ingo