comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » carriage-return-carriage-control
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
carriage-return-carriage-control [message #25890] Wed, 25 July 2001 15:35 Go to next message
differentiable is currently offline  differentiable
Messages: 5
Registered: June 2001
Junior Member
Hi!

I'm working on a vax with IDL 4.0 :) I have a HUGE binary file,
with sequential, variable length records separated by a carriage return
carriage control character. The problem is that the records aren't in the
right order! Each record has a header with a time stamp that I can use to
sort the file with. Any suggestions on how to read from the file and figure
out where each record begins? I've tried so many things! Please help!
My thanks are yours; Lucas.
Re: carriage-return-carriage-control [message #25961 is a reply to message #25890] Fri, 27 July 2001 05:21 Go to previous message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Lucas Miller wrote:

> I'm working on a vax with IDL 4.0 :) I have a HUGE binary file,
> with sequential, variable length records separated by a carriage return
> carriage control character. The problem is that the records aren't in the

I don't know exactly what this carriage control stuff ist... can the
next record be identified just by finding the carrage returns (CR, ASCII
code 13)?

> right order! Each record has a header with a time stamp that I can use to
> sort the file with. Any suggestions on how to read from the file and figure
> out where each record begins? I've tried so many things! Please help!

If your file fits completely into memory (if it's HUGE it probably
doesn't), read it via READU:

openr, unit, filename, /get_lun
array = bytarr( (fstat(unit)).size )
readu, unit, array
free_lun, unit
record_start = where( array eq 13b, n ) + 1
timestamps = array[record_start]
; or something like that, depending on how this timestamp is defined
sort_index = sort( timestamps )

If your file is too huge, try reading it in chunks, and have a look at
the ASSOC() function.

Alex
--
Alex Schuster Wonko@planet-interkom.de
alex@pet.mpin-koeln.mpg.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: cursor_image
Next Topic: Windows Metafiles

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:11:30 PDT 2025

Total time taken to generate the page: 0.00501 seconds