Skip to content

Instantly share code, notes, and snippets.

@ajdamico
ajdamico / import SAS ASCII file into R with SAS INPUT text file
Created May 4, 2010 22:11
import SAS ASCII file into R with SAS INPUT text file
##select file containing SAS input procedure
SASinput <- readLines(file.choose())
##find the first INPUT line
firstline<-min(grep("INPUT @1",toupper(SASinput)))
##find the first semicolon ending that input line
a<-grep(";",toupper(SASinput))
lastline<-min(a[a>firstline])