- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How do I remove cr's from a file ??
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
11-24-2003 03:18 AM
11-24-2003 03:18 AM
I wondered if you could help.....
I need to remove cr's (carriage returns) from a file.
many thanks
Lee
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:20 AM
11-24-2003 03:20 AM
Re: How do I remove cr's from a file ??
Cheers
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:34 AM
11-24-2003 03:34 AM
Re: How do I remove cr's from a file ??
Cheers
Lee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:36 AM
11-24-2003 03:36 AM
Re: How do I remove cr's from a file ??
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:37 AM
11-24-2003 03:37 AM
Re: How do I remove cr's from a file ??
Cheers
Lee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:38 AM
11-24-2003 03:38 AM
Re: How do I remove cr's from a file ??
You can also use the 'dos2ux' command.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:38 AM
11-24-2003 03:38 AM
Re: How do I remove cr's from a file ??
dos2ux
and
ux2dos
they exists just for that :)
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:42 AM
11-24-2003 03:42 AM
Re: How do I remove cr's from a file ??
well, I guess that your CRs are not byte 10. Please create the file myfile with only two lines holding this text:
line1
line2
and post the output of this command:
# head myfile| od -x
it should look like this:
0000000 6c69 6e65 310a 6c69 6e65 320a
0000014
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:50 AM
11-24-2003 03:50 AM
Re: How do I remove cr's from a file ??
you can also use ftp to transfer the binary to your computer and then ascii back.
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 03:53 AM
11-24-2003 03:53 AM
Re: How do I remove cr's from a file ??
Johns doesnt work. It deletes the newlines. To delete carriage returns, you would have to use:
tr -d "\015" <./infile > ./outfile
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2003 11:08 AM
11-24-2003 11:08 AM
Re: How do I remove cr's from a file ??
\n is a line feed
\012 is also line feed
\r is carriage return
\015 is also carriage return
so "cat |filename |tr -d "\r" "" > newfile"
will remove carriage returns.
If the data file you have was a binary transfer of text text file from an Old Mac you would need to translate
the \r to \n becuase they only had \r
so "cat |filename |tr "\r" "\n" > newfile"
"strings filename > newfile"
will also work
When ftp'ing textfiles between different platforms (windows,mac and unix). set the file type to ascii and your \cr\lf,\cr,\lf problems will be less
Rory