Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Handling ^M's in text files

Re: Handling ^M's in text files

From: Galen Boyer <galenboyer_at_hotpop.com>
Date: 28 Oct 2002 21:17:12 -0600
Message-ID: <u65vl69tc.fsf@hotpop.com>


On 29 Oct 2002, tcross_at_nospam.une.edu.au wrote:
> Kenneth C Stahl <ktsahl_at_yahoo.com> writes:
>

>> Tim Cross wrote:
>> > 
>> > Ubiquitous <weberm_at_polaris.net> writes:
>> > 
>> sed 's/^M//g' infile.txt >outfile.txt

>
> or in perl
>
> perl -pe 's/\r//g' infile.txt > outfile.txt
>
> ;-)

Or put the following in your .emacs,

    (defun cut-ctrlM ()

      "Cut all visible ^M."
      (interactive)
      (beginning-of-buffer)
      (while (search-forward "\r" nil t)
        (replace-match "" nil t))
      (not-modified)
      (beginning-of-buffer))

    (global-set-key [f5] 'cut-ctrlM)

Then, whenever you see this, hit f5.

:-)

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.
Received on Mon Oct 28 2002 - 21:17:12 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US