- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Getting rid of metacharacters (^M) with VI or ...
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
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
тАО04-21-2002 07:10 AM
тАО04-21-2002 07:10 AM
Is there a simple way I can get rid of this metacharacter? There are a few scripts that work together and right now they all have that character at the end.
I was able to run a single script by manually deleting the character at the end of each line, but the entire program will not work because many of these tie together,this unless all other files are also cleaned up.
Why did this happen?
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2002 07:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2002 07:19 AM
тАО04-21-2002 07:19 AM
Re: Getting rid of metacharacters (^M) with VI or any other way?
Using vi, type :
and then -->
1,$s/^V^M//g
This will replace the metachacter ^M
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2002 07:24 AM
тАО04-21-2002 07:24 AM
Re: Getting rid of metacharacters (^M) with VI or any other way?
There are many ways by which you could delete the unprintable/control characters ...
Here are a couple of ways you could do this:
strings badfilename > goodfilename
dos2unix badfilename > goodfilename
Hope this helps !
Thanks,
Shabu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2002 08:00 AM
тАО04-21-2002 08:00 AM
Re: Getting rid of metacharacters (^M) with VI or any other way?
the correct command under hp-ux is "dos2ux", but the usage is ok.
Heiner
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2002 10:00 AM
тАО04-21-2002 10:00 AM
Re: Getting rid of metacharacters (^M) with VI or any other way?
Thanks everyone...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2002 06:43 AM
тАО04-22-2002 06:43 AM
Re: Getting rid of metacharacters (^M) with VI or any other way?
Try with sed:
sed 's/.$//g' file > newfile
HTH
RGDS, Holger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2002 08:12 PM
тАО04-22-2002 08:12 PM
Re: Getting rid of metacharacters (^M) with VI or any other way?
# cat
e.g,
# cat file1 |col -b >file.new
--Niraj