For input into R: data <- scan(what = list(aggregate="",compaction="",strength=0), multi.line=F) Basalt Static 68 Basalt Static 63 Basalt Static 65 Basalt Basalt Regular 128 Basalt Regular 133 Basalt Low 93 Basalt Low 101 Basalt Low 98 Basalt VeryLow 56 Basalt VeryLow 59 Basalt VeryLow 57 Silicious Static 71 Silicious Static 66 Silicious Static 66 Silicious Regular 107 Silicious Regular 110 Silicious Regular 116 Silicious Low 63 Silicious Low 60 Silicious Low 59 Silicious VeryLow 40 Silicious VeryLow 44 data concrete <- data.frame(data) rm(data) For input into SAS: data concrete ; length aggregate $ 10 ; input aggregate $ compaction $ r ; do i = 1 to r ; input strength @@ ; output ; end ; cards ; Basalt Static 3 68 63 65 Basalt Regular 2 128 133 Basalt Low 3 93 101 98 Basalt VeryLow 3 56 59 57 Silicious Static 3 71 66 66 Silicious Regular 3 107 110 116 Silicious Low 3 63 60 59 Silicious VeryLow 2 40 44 ; proc print data = concrete ; run ;