Re: replacing ^M with emacs



On Fri, Oct 27, 2006 at 12:26:25PM -0700, Noah wrote:

Hi there,

It appears that a text editor placed a bunch on ^M throughout a text
file I am working with. I assure this is equivalent to eh keystroke
control-M.

This is probably "MS-DOS" type text file. MS text file lines
all end in a CR-LF character pair whereas UNIX text file lines
have only a LF (line feed) and the end of each line.
All text editors on MS systems do that and if you do a binary transfer
of a file from MS to UNIX you will get all the extra ^M characters
showing up. most versions of ftp have an ASCII mode that will
do the conversion for you as you transfer the file back and forth
between MS and UNIX. I think SCP only does binary transfers.

I am not an Emacs user, but,
You can easily use tr(1) to remove all the ^M characters from a
file. tr -r "\r" <badfile >goodfile
where badfile is the one with the ^M characters and goodfile is
the newly cleaned copy. The only anoying thing is having to
write to a second file and then get rid of the first or mv the
new one back to the old (as in: mv goodfile badfile after doing
the tr.

////jerry


How might I get emacs to search replace

also is there a mail list focused specifically on emacs usability?
please refer me to it?

Cheers,

Noah

_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: replacing ^M with emacs
    ... all end in a CR-LF character pair whereas UNIX text file lines ... All text editors on MS systems do that and if you do a binary transfer ... of a file from MS to UNIX you will get all the extra ^M characters ... use C-x RET f unix RET. ...
    (freebsd-questions)
  • Enhanced JCL processor? (and maybe a few other thoughts)
    ... I would prefer that JCL be VB. ... The first three characters of the ... // THE PARM' ... UNIX user" is defined, then it is the "default UNIX user's" home ...
    (bit.listserv.ibm-main)
  • Re: Characters displayed small
    ... characters between different sets. ... functions that make emacs consider equally the characters from latin-1 ... set using a different font as told by the fontset. ... emacs-snapshot debian package. ...
    (comp.emacs)
  • Re: qx() wont accept over (about) 128,000 characters
    ... and submit the result to a Unix operating system ... I submit such a program to the operating system using Perl's ... Unfortunately, giving qxover 128,420 characters (about and can vary ... $ perl -e' ...
    (perl.beginners)
  • Re: Barcode printing: Unix to HP?
    ... They are passed as a Hex A2 and Hex A4, respectively, (and show ... All I'm getting are the data characters ... and check character in the barcodes, ... Are there any print queue settings on the Unix side I need to change? ...
    (comp.unix.aix)

Loading