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


Groups > comp.soft-sys.math.mathematica > #15892

Re: on importing/exporting binary files

From "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: on importing/exporting binary files
Date 2011-02-12 10:18 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ij5mqa$jj9$1@smc.vnet.net> (permalink)
References <ij2usr$7rk$1@smc.vnet.net>

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

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

csiph-web