AjayT <ajaytalati <at> googlemail.com> writes: > The data looks like this, > > Id=1 time=2011-03-27 19:23:40 start=1.4018 end=1.4017 > Id=2 time=2011-03-27 19:23:40 start=1.8046 end=1.8047
Something like this would do: lines = scan(file, nlines=1, ...) fields = strsplit(lines[1], "\s+", perl=TRUE) k.v.pairs = sapply(fields, function(f) { strsplit(f, "=") }) df.row = sapply(k.v.pairs, function(k.v) { k.v[2] }) You can then rbind() the df.row values to get a data.frame. Note that this assumes that all your input records have all the same fields and all in the same order. ______________________________________________ R-help@r-project.org 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.