Operating System - HP-UX
1830062 Members
2208 Online
109998 Solutions
New Discussion

Big-endian to little-endian?

 
SOLVED
Go to solution
Andrew F Greenwood
Occasional Advisor

Big-endian to little-endian?

Hi,

I have a file that I want to be able to convert on HPUX so that it can be used on WinNT (on i386). It needs to be converted from big-endian to little-endian, a process that currently happens on the NT box.

For scheduling reasons I would like this to happen on HPUX - does anyone know how? It looks as if the GNU version of cpio has some added functionality in this area, but I didn't get too far with that route.

Any help much appreciated.
3 REPLIES 3
Tom Geudens
Honored Contributor

Re: Big-endian to little-endian?

Hi,
Try
#man swab

Regards,
Tom Geudens
A life ? Cool ! Where can I download one of those from ?
harry d brown jr
Honored Contributor
Solution

Re: Big-endian to little-endian?

You can also use "dd conv=swab if= of="

live free or die
harry
Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: Big-endian to little-endian?

Hi Steve:

Dd using the conv=swab option will do this but typically the conversions are not that simple. The text data does not need to be 'swabbed' while the binary integer data and floating point data does. It is rather common to have to write a small c program to do this but you may be one of the lucky few.
If it ain't broke, I can fix that.