Re: [R] Reading multiple tables from file

2008-05-09 Thread G. Draisma
Dear Mr Holman, Thanks very much for your help. This is what I was looking for. Gerrit. on 2008-05-08 20:31 jim holtman said the following: Will this do it for you: x - readLines(textConnection(1 + Pietje + I1 I2 Value + 1 1 0.11 + 1 2 0.12 + 2 1 0.21 + + 2 + Jantje + I1 I2 I3 Value +

[R] Reading multiple tables from file

2008-05-08 Thread G. Draisma
Dear R-users, I have output files having a variable number of tables in the following format: - 1 Pietje I1 I2 Value 1 1 0.11 1 2 0.12 2 1 0.21 2 Jantje I1 I2 I3 Value 1 1 1 0.111 3 3 3 0.333 ... - Would there be an easy way of turning this into (a list of)

Re: [R] Reading multiple tables from file

2008-05-08 Thread jim holtman
Will this do it for you: x - readLines(textConnection(1 + Pietje + I1 I2 Value + 1 1 0.11 + 1 2 0.12 + 2 1 0.21 + + 2 + Jantje + I1 I2 I3 Value + 1 1 1 0.111 + 3 3 3 0.333)) closeAllConnections() start - grep(^[[:digit:]]+$, x) mark - vector('integer', length(x)) mark[start] - 1