MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

BinaryRead question

  • To: mathgroup at
  • Subject: [mg119871] BinaryRead question
  • From: Ted Sariyski <tsariysk at>
  • Date: Mon, 27 Jun 2011 07:31:18 -0400 (EDT)
  • References: <>


I have data which are available both in ASCII and binary formats. 
Importing ASCII data is really slow, between 3 and 5 minutes and I have 
many files. I tried BinaryRead but I need help here. Binary data 
consists of records. The first 32     bytes are the variable name, 
followed by numberOfPoints real*4. The first record in the file is 
numberOfPoints (integer*4):

var1 dataVar1(1:numberOfPoints)
var2 dataVar2(1:numberOfPoints)
Data are stored on Linux x86_64  machine in big-endian byte order.  
Could someone provide a template how the code should look like, please?

I have another related question.  I was thinking to use pipe 
(BinaryRead["!readData",...]), but I am confused because Mathematica is 
running on Windows7 and data are on Unix. I see two options: 1) to 
compile readData on Windows, or 2) to execute readData remotly e.g. "ssh 
remoteMachine  readData dataFn". I prefer the second way because i 
already have utilities to handle these data on Unix. Is there a document 
which provides examples for this type of data import?

Thanks in advance,

  • Prev by Date: Stylesheet questions
  • Next by Date: Re: what's in a name? (legal and conventional constructions of identifiers)
  • Previous by thread: Re: parsing a strig
  • Next by thread: how to visualize unstructured data