- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to convert binary file to ASCII
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
тАО02-26-2003 03:45 PM
тАО02-26-2003 03:45 PM
How to convert binary file to ASCII
I can't seem to find a command to convert my
binary file to ASCII.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2003 03:52 PM
тАО02-26-2003 03:52 PM
Re: How to convert binary file to ASCII
There is no standard command in HP-UX to do this.
There is a pkg btoa on the porting center that purports to do this. Here's the link:
http://hpux.cs.utah.edu/hppd/hpux/Misc/btoa-5.2/
I've never used it, though.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2003 03:58 PM
тАО02-26-2003 03:58 PM
Re: How to convert binary file to ASCII
You can use the 'strings' command to see what printable characters are in the binary file. Do a 'man strings' for more details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2003 04:39 PM
тАО02-26-2003 04:39 PM
Re: How to convert binary file to ASCII
Depending upon the layout of your binary file, this can be a far from trivial task. As mentioned, if it's easy you can use the strings command to recognize portions of your data (if the strings are encoded as ASCII rather than EBCDIC) or you can use the od command with various options to display integers, charaters, etc. The real problem comes in coverting the 1st 8 bytes of record to floating-point, the next 2 bytes as a short unsigned integer, the next 4 bytes as a signed integer, the next 6 bytes COBOL COMP data, and the next 30 characters as a string, .... . If that is the case the it's time to do real programming (at a minimum Perl but usually C or C++).
Just knowing the exact layout of each record is the first hurdle (and just hope you don't have to deal with variable length records).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2003 05:27 PM
тАО02-26-2003 05:27 PM
Re: How to convert binary file to ASCII
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2003 06:11 AM
тАО02-27-2003 06:11 AM
Re: How to convert binary file to ASCII
With the "-n" option of vis and inv, you can make a simple binary editor:
vis -n
vi file.txt
inv -n
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2003 10:24 AM
тАО02-27-2003 10:24 AM
Re: How to convert binary file to ASCII
It would be helpful if you defined what you mean by a binary file.
text, database, archive, executable, pdf, jpeg etc..
If you mean text files transported into your system useng ftp. it is sometime usefull to do so by using the binary option. inorder to preserve CR/LF (carraige returns-linefeeds) or
LF
or
CR
MSDOS uses CR/LF
UNIX uses LF
MAC uses CR.
If your intent is to convert a
"binary" MSDOS text file to a UNIX text file. There are all kinds of ways (tr, sed, awk, perl).
PDF, DATABASE and compressed files would require some els
Rory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2003 06:10 AM
тАО02-28-2003 06:10 AM
Re: How to convert binary file to ASCII
ryan