- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to use "regular expression" to delete "^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
тАО01-30-2001 09:00 PM
тАО01-30-2001 09:00 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2001 09:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2001 09:56 PM
тАО01-30-2001 09:56 PM
Re: How to use "regular expression" to delete "^M" character
It's easy ! First of all hit ':' to go in 'ex' mode.
Then type the following:
1,$s/
That's it !
Dan
PS:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2001 10:36 PM
тАО01-30-2001 10:36 PM
Re: How to use "regular expression" to delete "^M" character
Alternatively,
$ cat with_ctrl_M.txt | col -b > without_ctrl_M.txt
Hope this helps. Regards.
Steven Sim
Brainbench MVP for Unix Admin
http://www.brainbench.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2001 12:52 AM
тАО01-31-2001 12:52 AM
Re: How to use "regular expression" to delete "^M" character
In addition to all the above ways...
You can do the following...
# strings nt_file.txt >new_file.txt
Hope this helps..;-)
Suhas Oka.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2001 06:04 AM
тАО01-31-2001 06:04 AM
Re: How to use "regular expression" to delete "^M" character
FTP the file as ASCII from the NT box to the UNIX box. The ^M is a
Hope this helps....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2001 06:38 AM
тАО01-31-2001 06:38 AM
Re: How to use "regular expression" to delete "^M" character
within vi you can remove ^M with:
1G
!G!dos2ux
1G will go to the first line of the document (entering is not visible)
!G will select the document form top to bottom (entering is not visible, after the G a ! occours at the bottom line)
dos2ux will remove the ^M from the selected lines.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-31-2001 10:54 PM
тАО01-31-2001 10:54 PM
Re: How to use "regular expression" to delete "^M" character
If for some reason you can't use dos2ux i would prefer the vi with substitiution like Dan posted. In addition to the post from Dan i would suggest using the following substitution:
1,$s/
With an additional "g" at the end. Which means "global". If the String you want to replace can be found several times in a line this global option will replace them all. Without this option only the first apperance in this line will be replaced.
Hope this helps and my english was good enough .
Stefan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2001 01:23 AM
тАО02-01-2001 01:23 AM
Re: How to use "regular expression" to delete "^M" character
%s/.$//
Laszlo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2001 02:26 AM
тАО02-01-2001 02:26 AM
Re: How to use "regular expression" to delete "^M" character
cat myfile | tr -d '\015'