[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: reading files with date- and time - columns
- Subject: Re: reading files with date- and time - columns
- From: Ray Sterner SRO <sterner(at)tesla.jhuapl.edu>
- Date: Fri, 02 Mar 2001 16:17:37 -0500
- Newsgroups: comp.lang.idl-pvwave
- Organization: Johns Hopkins University Applied Physics Lab, Laurel, MD, USA
- References: <97ddh6$onb1m$1@fu-berlin.de>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:23877
Zeschke wrote:
> File : s.log
> ;DATE TIME n x VALUES
> 23.01.2001 08:39:41 21 21.4 0
> 23.01.2001 08:40:16 21 21.3 0
> 23.01.2001 08:40:51 21 21.3 0
> 23.01.2001 08:41:26 21 21.4 0
>
> or such a format:
>
> ;DATE TIME n x VALUES
> 2/23/2001 08:39:41.643 34.660
> 2/23/2001 08:49:41.456 34.960
If the file is fixed format, all the columns line up, one way
to do this is to read the entire file into a string array, then
use strmid to pick off columns like hours, minutes, seconds.
These may then be combined as desired. This works quite well,
the main problem might be getting all the lines into an array
(if they will fit). For unix/linux a spawn of wc gives the number
of lines. fstat can probably be used also to compute that number.
Ray Sterner ray.sterner@jhuapl.edu
The Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099