Re: converting uint8 arrays to integers, floats an



William L. Slater wrote:
>
>
> Hey Matlab Family:
>
> I've got to process some files FTP'd from a VAX machine. In these
> files are various types of data: bytes, short integers, long
> integers, floats, and doubles. Parsing the data off by category is
> no problem, but interpreting them is. For instance, a page of data
> might be formated as follows: double(1), byte(3), short(1),
> long(1),
> byte(5), double(1). And there might be 200000 pages in a file.
>
> I can fread all the raw data from the file, and reshape it to match
> the number of pages (columns). Thus, I can parse of this matrix by
> rows for each category of data: the first 8 rows represent the
> first
> double category, the next three for the 3 bytes, and so on.
>
> Is there a way that I can convert these groups of rows to their
> respective data type? What I've been doing so far is using frwite
> to
> write each group of rows to a temp file and fread them back in with
> the appropriate format. This gives me the results I want, but when
> dealing with dozens of data categories and hundreds of thousands of
> pages it can take a long time. Is there a way to do this in
> memory?
>
>
> Oh, BTW, I've seen the uread file in the File Exchange. I'm not
> sure
> if it can read floats and doubles in the 'vaxg' format that I need,
> like fread does.
>
> Any help would be greatly appreciated. Thanks

Hi William.

I don´t know if this will help in your case, but in ML7 there is a
function called memmapfile which seems appropriate for this kind of
work. Unfortunately I don´t have any experience in using it. In this
thread:
<http://tinyurl.com/a3kze>
Jesper Göransson showed how he used it.

HTH

PB
.



Relevant Pages

  • converting uint8 arrays to integers, floats and doubles
    ... integers, floats, and doubles. ... I can fread all the raw data from the file, ... the appropriate format. ...
    (comp.soft-sys.matlab)
  • RE: sort alphanumeric
    ... I have the same problem as William, but your solution does not work on my ... "Sloth" wrote: ... I then changed the format to text and got the same ... Here is what im trying to sort: ...
    (microsoft.public.excel.misc)
  • Re: FIXMBR redux
    ... Michael, I don't know what you mean by 'format jumbled' on ... > installed that this is running up against XP's anti-piracy scheme. ... William B. Lurie ...
    (microsoft.public.windowsxp.basics)
  • Re: Wrestling news: Unforgiven, Foley debuts, ratings
    ... In article, William ... Baldwin wrote: ... The format: Two men start the match, ... The first time I read this, ...
    (rec.arts.tv)
  • Re: Query: when is a .wav not a .wav?
    ... William D. Tallman wrote: ... >> Don't assume you got a file with the right format just because it ... > mono 22050 Hz ...
    (alt.os.linux)