MathGroup Archive 2011

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

Search the Archive

Re: on importing/exporting binary files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116370] Re: on importing/exporting binary files
  • From: "Sjoerd C. de Vries" <sjoerd.c.devries at gmail.com>
  • Date: Sat, 12 Feb 2011 05:18:56 -0500 (EST)
  • References: <ij2usr$7rk$1@smc.vnet.net>

Try BinaryRead, BinaryReadList and BinaryWrite. See tutorial/
BinaryFiles and the respective doc pages of these commands.

BinaryRead also reads strings, so as long as you know where the text
header ends (keyword, number of words etc.), it should be possible to
read the first part as strings and the remaining as pure binary.

Cheers -- Sjoerd

On Feb 11, 10:18 am, Luigi B <l.balz... at gmail.com> wrote:
> Dear All,
>  I have some files that contain a text header followed by binary data.
> My problem is to open the file, change a line in the (text) header and
> close it (saving it).
> I tried with  "Import"  but it takes long time and when I "export" the
> files the binary part gets messed up.
>
> Does anyone know how to do this efficiently as I have thousands of
> files that need to be processed?
>
> Thanks, Luigi



  • Prev by Date: Re: ContourPlot confusion
  • Next by Date: Nonorthogonal Eigenvectors
  • Previous by thread: on importing/exporting binary files
  • Next by thread: Re: on importing/exporting binary files