Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15628 > unrolled thread

on importing/exporting binary files

Started byLuigi B <l.balzano@gmail.com>
First post2011-02-11 09:18 +0000
Last post2011-02-12 10:18 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  on importing/exporting binary files Luigi B <l.balzano@gmail.com> - 2011-02-11 09:18 +0000
    Re: on importing/exporting binary files "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-02-12 10:18 +0000

#15628 — on importing/exporting binary files

FromLuigi B <l.balzano@gmail.com>
Date2011-02-11 09:18 +0000
Subjecton importing/exporting binary files
Message-ID<ij2usr$7rk$1@smc.vnet.net>
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

[toc] | [next] | [standalone]


#15892

From"Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com>
Date2011-02-12 10:18 +0000
Message-ID<ij5mqa$jj9$1@smc.vnet.net>
In reply to#15628
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...@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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web