[R] Partially reading a file (particularly)

From: Tobin, Jared <TobinJR_at_DFO-MPO.GC.CA>
Date: Tue, 29 May 2007 17:33:05 -0230


Hello,

I am trying to figure out if there exists some R command that allows one to be
particularly selective when reading a file. I'm dealing with large fixed-width data
sets that look like

539001..
639001..
639001..

...

539002..
639002..
...

Presently, I am using read.fwf to read an entire file, but I am interested only in
reading those records beginning with 5. I have been unable to find help in any of
the suggested resources.

I understand this is a SAS example that replicates what I'm looking to do, if it's of
any help to anyone.

street type		name					am
traffic	pm traffic

freeway		408					3684
3459
surface		Martin Luther King Jr. Blvd.	1590		1234
freeway		608					4583
3860
freeway		808					2386
2518
surface		Lake Shore Dr.			1590		1234

INPUT type $ @;
IF type = 'surface' THEN DELETE;
INPUT name $ 9-38 amtraff pmtraff;

Any answers, suggestions, or points-in-the-right-direction would be much appreciated.

--

Jared Tobin, Student Research Assistant
Dept. of Fisheries and Oceans
tobinjr_at_dfo-mpo.gc.ca

______________________________________________
R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 29 May 2007 - 20:15:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 May 2007 - 23:31:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.