- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: vi editor ^M char
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2002 11:58 PM
01-24-2002 11:58 PM
vi editor ^M char
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:00 AM
01-25-2002 12:00 AM
Re: vi editor ^M char
# cat src.txt | col -b > dst.txt
or
# strings src.txt > dst.txt
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:18 AM
01-25-2002 12:18 AM
Re: vi editor ^M char
If you copied the file from a PC then put it through dos2ux
in vi
:1,$s/cntrlVcntrlM//
cntrlV = Control+v
cntrlM = Control+m
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:19 AM
01-25-2002 12:19 AM
Re: vi editor ^M char
: 1,$s/^M//g
N.B For ^M press Ctrl+v then imediatltly press m
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:21 AM
01-25-2002 12:21 AM
Re: vi editor ^M char
Silly thing was I actually tested before I sent the reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:26 AM
01-25-2002 12:26 AM
Re: vi editor ^M char
!Gcol -bx
See what happen?
/discoverer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:26 AM
01-25-2002 12:26 AM
Re: vi editor ^M char
You can do this within vi
:1,$ s/^V^M//
(NOTE You need the ^V then ^M
in order to enter the ^M charatcer)
This will erase the ^M character from each line.
HTH,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:45 AM
01-25-2002 12:45 AM
Re: vi editor ^M char
If you get it from Win and ftp use ascii mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:51 AM
01-25-2002 12:51 AM
Re: vi editor ^M char
...or you could do this in vi:
:%s/.$//
to remove the last char from every line.
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 12:54 AM
01-25-2002 12:54 AM
Re: vi editor ^M char
Use the dos2ux command to strip out microsnot characters!
dos2ux
MND
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 05:59 AM
01-25-2002 05:59 AM
Re: vi editor ^M char
:%s/cntrlV invio//g
with cntrlV you can insert ^M with invio.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 07:43 AM
01-25-2002 07:43 AM
Re: vi editor ^M char
Another solution
Problem Description
I have transferred a file from another system, and I am editing the file
with the vi editor. The file has embedded carriage returns, which the
editor is displaying as ^M. How can I remove these extra characters?
Configuration Info
System 9000 HP-UX
Solution
Use the tr(1) command to remove these characters from the file.
First, quit the vi editor and then do the following:
Execute the tr command:
1. tr -d \\015 < inp_file > new_file
2. Inspect the file new_file with vi to check that the ^M's are gone.
steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2002 11:04 AM
01-25-2002 11:04 AM
Re: vi editor ^M char
%s/^V^M$//g
Should take care of your anchor.