From: sibir on 12 Nov 2009 06:21 I have some binary files with mixed ByteOrdering. The actual data is little endian but the metadata in the header is big endian. Is there a clever way to swap the bytes in a short integer? My first shot looks rather ugly: swapBytes[b_] := BitOr[BitShiftLeft[BitAnd[255, b] 1, 8], BitShiftRight[b, 8]] Cheers
|
Pages: 1 Prev: Importing Excel File into mathematica Next: Filling in ListPlot |