How do I get rid of the ^M characters from a text file
that appear when using Emacs?
Thanks,
How do I get rid of the ^M characters from a text file
that appear when using Emacs?
Thanks,
tr -d '\015' < infile > outfileQuote:> How do I get rid of the ^M characters from a text file
> that appear when using Emacs?
> Thanks,
> How do I get rid of the ^M characters from a text file
> that appear when using Emacs?
tr -d '\015' <in >out
Quote:> Thanks,
Pierre> I assume you are on Unix. Try:Quote:>> How do I get rid of the ^M characters from a text file
>> that appear when using Emacs?
Pierre> tr -d '\015' <in >out
Yes, but if you are already in Emacs, why not simply do the following:
M-x replace-string C-m C-q C-m C-m
--jmf
--
+----------------------------------+----------------------------------+
| Jose M. Figueroa-O'Farrill | Vox: +44.171.975-5055 |
| Department of Physics (Rm. 227) | Fax: +44.181.981-7465 |
| Mile End Road, London E1 4NS, UK | |
| or |
| check out http://stringswww.ph.qmw.ac.uk/~jmf/jmf.html on the WWW. |
+----------------------------------+----------------------------------+
Pierre> I assume you are on Unix. Try:Quote:>>> How do I get rid of the ^M characters from a text file
>>> that appear when using Emacs?
Pierre> tr -d '\015' <in >out
jmf> Yes, but if you are already in Emacs, why not simply do the following:
jmf> M-x replace-string C-m C-q C-m C-m
Sorry, I left out a C-m!
Try this:
M-x replace-string C-m C-q C-m C-m C-m
Sorry about the typo above...
--jmf
--
+----------------------------------+----------------------------------+
| Jose M. Figueroa-O'Farrill | Vox: +44.171.975-5055 |
| Department of Physics (Rm. 227) | Fax: +44.181.981-7465 |
| Mile End Road, London E1 4NS, UK | |
| or |
| check out http://stringswww.ph.qmw.ac.uk/~jmf/jmf.html on the WWW. |
+----------------------------------+----------------------------------+
:> How do I get rid of the ^M characters from a text file
:> that appear when using Emacs?
query-replace-string ^M with ''
where '' is nothing, just hit enter.. that should kill them
if you wanted to shell out for a second, you could also:
sed s/^M// < input_file > output_file
--
----------------------+--------------------------------------------------
----------------------+ of Atogs. I will still accept them at NO CHARGE to
Brian Cully | you! Email me for information about my home for
: :> How do I get rid of the ^M characters from a text file
: :> that appear when using Emacs?
: query-replace-string ^M with ''
: where '' is nothing, just hit enter.. that should kill them
: if you wanted to shell out for a second, you could also:
: sed s/^M// < input_file > output_file
How to do the reverse? I've got a Unix file and I open it in Word for
Windows 2.0c and found that there're carriage returns at the end of each
line. How to remove the CRs and re-paginate the text?
--
Kevin Yeung
pager: (852)1128-903 a/c 8004
: How do I get rid of the ^M characters from a text file
: that appear when using Emacs?
tr -d -c '\r' < infile > outfile
--
+--------------------------------------------------------------------------
Australia FidoNet 3:711/907
+--------------------------------------------------------------------------
>: How do I get rid of the ^M characters from a text file
>: that appear when using Emacs?
>tr -d -c '\r' < infile > outfile
>--
>+-------------------------------------------------------------------------
> Australia FidoNet 3:711/907
>+-------------------------------------------------------------------------
>: How do I get rid of the ^M characters from a text file
>: that appear when using Emacs?
>tr -d -c '\r' < infile > outfile
cat infile |col -b > outfile
Do be aware that this strips ALL control characters!
--
--
: In UNIX V.4, I use col(1)
: cat infile |col -b > outfile
: Do be aware that this strips ALL control characters!
: --
--
I found some source code that I compiled on my system to convert from
pc text to unix text and also the other way around
the file was
pc2unix.zip
and should show up with a search at an archie site or another.
it includes pc2unix and unix2pc code.
I compiled it on my system and it works fine so far, I don't think I've
tried any files with other control characters besides ^M, but it's worked
fine for everything else.
After compiling the code and doing chmod on it, you use it like a filter
pc2unix < text.dos > text.unix
or
cat text.unix | unix2pc > text.dos
i.e. just send text to it and redirect its output to a file somewhere.
I don't do programming yet so I was plenty satisfied with getting it to
work using the instructions that came with it.
*************************************************************
]M- XEU?_ ?+_? WV?v ?F |tZ?F &?< tQj & ??|_ Ph? ?F PV< ?|_
PG RP?|_ P ?|_ P__ a- ?FnW+ ?Fn_ joj j j j j j j 5 ++^_MM?_
NO CARRIER
1. how to read a text file and write it into a new file character by character?
Actually, i want to delete some unnecessary characters from the old files.
Thanks
2. Tar: "UTF-8 conversion failed" Warning or fatal?
3. removing control characters from text files
4. Q: Running X-Window on AcerNote NUOVO
5. Removing the first character of a text file
6. Apache SECURITY ADVISORY: June 17, 2002
7. Removing Control Characters From A Text File
8. Dosemu: ATI gup, Ctrl-<key> in X.
9. remove control characters from a text file using vi
10. the last two characters of a dos text file are?
11. Dos Text Files to Linux Text Files
12. conver dos text file to unix text file
13. Cdrom removes execute perms and converts dos text.