(from http://www.computing.net/answers/unix/remove-m-and-line-feeds/6934.html)
anupam May 23, 2005 at 21:11:55 PacificHi..to remove ^M, give the command :
sed -e 's/^M//g' filename
you will have to write the control-M as follows : first press control-V,then control-M,this will show the correct control-M on the command line.
For removing the linefeeds,try this :
sed -e 's/.$//g' filename
this will remove the last character from the line,which happens to be the line feed.
Python, IaC, algo trading, programming, server administration, Linux, PHP, CakePHP, PostgreSQL, MySQL, Joomla ...
Sunday, December 19, 2010
sed script to strip ^M characters
this may also be handy, to strip ^M characters:
Subscribe to:
Post Comments (Atom)
cancel script completely on ctrl-c
I found this question interesting: basically how to cancel completely a script and all child processes : You do this by creating a subro...
-
I've been using WinScp and a script to compress files at maximum compressiĆ³n, name the file as name_YYMMDD-HHMM.rar, and send them to a...
-
tomado de: http://el-directorio.org/ErroresComunesPhpmyadmin ARREGLAR ERROR 1045 (28000): Access denied for user 'root'@'localho...
-
Styling Excel cells with mso-number-format mso-number-format:"0" NO Decimals mso-number-format:...
No comments:
Post a Comment