Skip to content
Back to formatted view

Raw Message

Message-ID: <A8877251964B294BAB5BA1FC58B43FED025B4476@molly.tas.csiro.au>
Date: 2002-12-27T04:43:02Z
From: Mark Bravington
Subject: Wish list: add an "until" or "EOF.marker" parameter to scan & rea dLines

A bit late for Santa, but on my wish-list nevertheless:

is there any chance that "scan" and "readLines" could be extended to take a
parameter "until" or "EOF.marker", which would be a character string that
(if encountered while reading) would cause the reading to stop, just as if
an end-of-file had been found? [But leaving a connection open, so that
subsequent calls could read the rest of the file.] Compatibility could be
ensured by making "until" default to as.character( NA), which can never be
encountered. If the "until" string isn't encountered when reading, then
reading continues until a real end-of-file (or the "n" parameter is
satisfied).

This would be useful in all sorts of contexts; one example is in processing
a single data file that's made up of multiple segments each of different
formats. 

cheers
Mark

*******************************

Mark Bravington
CSIRO (CMIS)
PO Box 1538
Castray Esplanade
Hobart
TAS 7001

phone (61) 3 6232 5118
fax (61) 3 6232 5012
Mark.Bravington at csiro.au