- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to change chars (CTRL+M)
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
Discussions
Discussions
Discussions
Forums
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
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
тАО06-05-2003 07:15 AM
тАО06-05-2003 07:15 AM
I have a file whith caracters wrong:
SELECT * FROM `M
SELECT * FROM `M
and I want to change all `M to nothing. Is it possible?, with vi, I can't change it, (its CTRL+M), Is there another way to do this?
Thanks very much.
Carmen.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2003 07:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2003 07:19 AM
тАО06-05-2003 07:19 AM
Re: How to change chars (CTRL+M)
Man dos2ux for details. ux2dos does the reverse operation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2003 07:19 AM
тАО06-05-2003 07:19 AM
Re: How to change chars (CTRL+M)
The control M appears in DOS text files when transfered to unix. You'll find a very old utility on every HP-UX system called dos2ux or ux2dos if you want to convert back. This should remove all the ^M's for you.
Cheers..
Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2003 07:20 AM
тАО06-05-2003 07:20 AM
Re: How to change chars (CTRL+M)
You can do it with vi. Do the following
vi
:%s/^M//g
You can get ^M by pressing Control-V and Control-M together.
Looks like you have a file copied from dos. The other way of getting rid of these characters is to use "dos2ux". 'dos2ux your_file > newfile'.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2003 07:23 AM
тАО06-05-2003 07:23 AM
Re: How to change chars (CTRL+M)
In vi it is possible do the change, use the following substitution:
:%s/^V^M//
Where ^V is CTRL+V and ^M is CTRL+M
Cheers.
Frank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2003 07:23 AM
тАО06-05-2003 07:23 AM
Re: How to change chars (CTRL+M)
You can use vi to get rid of them in command mode:
:1,$ s/ctrl+v ctrl+m//
Note: there is no space between the two "ctrl+v" and "ctrl+m". I just wanted to make the command sequence visible.
Hai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-05-2003 07:24 AM
тАО06-05-2003 07:24 AM
Re: How to change chars (CTRL+M)
Thanks a lot of!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-06-2003 09:46 AM
тАО06-06-2003 09:46 AM
Re: How to change chars (CTRL+M)
We know that CTRL-M is octal 015. So to remove it from the file try this:
cat file1 | tr -d '\015' > file2
Now file2 has no CTRL_M characters and you still have the original file1 for reference.
Hope it works,
Lucky Lou :-)