[R] Read text into a nested list
remkoduursma at gmail.com
Mon Jul 16 08:51:18 CEST 2012
I am looking for a way to efficiently read a text file (see example below)
into a nested list. I can probably find an ugly way to do this, but I would
appreciate if anyone has (ideas for) efficient solutions.
It seems to me this is a bit similar to parsing XML, could tools from the
XML package be used/changed to read custom files like these?
## Text file looks like, for example:
some more text
with more text lines
a sub node
## The result should look like :
# (extra points for naming the elements of the list, but not necessary!)
 "some more text"
 "some component
 "with more text lines"
 "another one"
 "a sub node"
View this message in context: http://r.789695.n4.nabble.com/Read-text-into-a-nested-list-tp4636613.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help