The easiest way (I can think of, anyway) is to use awk to extract the data
before reading into Splus. You didn't say what OS you're using, which
happens to Windoze users the most (they don't seem to realize there *are*
other OSs). There are several versions of awk under Windoze, e.g., cygwin.
Assuming the files are delimited by white space, you can do something like:
awk '$1=="I" || $1=="S"' original.data > filtered.data
at the command prompt. This extracts all rows where the first column are
either "I" or "S" and write them out to the file "filtered.data". You can
even give awk all the input files at the same time, if you don't need the
output in separate files.
HTH,
Andy
> -----Original Message-----
> From: Frank Lawrence [mailto:Cougar@psu.edu]
> Sent: Sunday, August 18, 2002 3:17 PM
> To: s-news@lists.biostat.wustl.edu
> Subject: [S] character to numeric
>
>
> I have multiple data files [ASCII format]. Each file is sequentially
> numbered and contains a combination of text and numbers. My
> interest in
> the text is only to identify rows. I want the rows that begin with 'I'
> or 'S'. There are multiple occurrences of the 'I' and 'S'
> rows in each
> data file. I want to extract the numbers in those rows that
> begin with
> 'I' or 'S' for further analysis. Each row of interest contains 8
> columns of numbers. I would like to put those columns of numbers in 8
> separate columns of a data frame. Furthermore, I would like
> to put in a
> row of "NA" if the row does not exist in the data file.
>
>
> Respectfully,
> Frank R. Lawrence
>
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu. To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message: unsubscribe s-news
>
------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may
be confidential, proprietary copyrighted and/or legally privileged, and is
intended solely for the use of the individual or entity named in this message.
If you are not the intended recipient, and have received this message in error,
please immediately return this by e-mail and then delete it.
==============================================================================
|