Description Usage Arguments Details Value See Also Examples
Reads a file and transforms it in a list (of lists) of characters
It is a slight generalization of file2list.
It is worth explaining why such a function was written.
The obvious one is that not always names for the components of the
list are natural. (In future version, it could be good to mixed with
and without names). Another reason is that the contraint of 'value
only at the final level is not always natural. read8list adds
itself 'null' components (named rbsa0$l00$v)
to allow it. Finally, levels can be skipped
and missing levels are introduced.
So the generalization is that
the components of the list have not to be given
in the file but are determined by the function from an additionnal
line (everywhere in the file) tagged with the third argument
starting at the first character.
This line contains the list of bullets, giving then their number.
Notice that all proposed bullets must be different from
rbsa0$l00$v.
But everything has to be paid: now the constraint is
that every component must have a non empty content.
1 2 3 4 5 6 7 8 9 10 11 |
file |
file to be read and transformed into a list. |
path |
Directory containing the file. |
bullet |
Indicates the bullets to be considered. This tags must be at the very beginning of a line. But the bullets can be preceeded by spaces. |
clean |
Indicates if starting and ending spaces of every lines must be eliminated at first. |
ended |
To indicate the line from which to stop the reading. |
comment |
At the beginning of a line, it indicates that this line must not be considered. More than one commenting character can be considered when it is a vector. For instance c("#","%") means that lines starting with an hash or a percent are comment lines. |
skip |
To indicate set(s) of lines to be skipped. Must be a character matrix where the two columns correspond respectively to the opening and closing tags, and where each row is associate to a couple of tags. Tags are considered successively following the order of these matrix rows. |
include |
Tags to indicate a file (including possible path) by a character(1) to include at this point its contents as a text file with the same tags specifications. Including files can be recursive. |
tags |
Character matrix with two columns indicating the opening and closing tags of the lists at different levels. Its row number gives the maximum number of levels. Opening tags must be different. |
sep |
Character sequence used to split the components of character vectors provided within the same line. Notice that LF is always considered as a separator. |
rsep |
Indicates if repetitions of sep must be considered as significant or not and which null value to introduce. If no_action then the repetitions will be ignored if not rsep component(s) will be introduced. |
stag |
Two character strings indicating the tag to define different sep for a given [sub]list. These two correspond to stag[c(1,3)] of list2file function. |
monitor |
List of constants indicating the monitoring choices, see the rbsa0$monitor$v provided object as an example. |
An intermediary file is generated (and not deleted) to be read by
file2list function; its name is obtained from the global constant
rbsa0$fin$v.
The numbering of the levels of the list is determined by cycling the
global constant rbsa0$tyl$v (run the example to have an idea of what this means).
Only the first three arguments plus the tags are used by this function, all others are
directly passed to file2list.
For the moment, the numbering of the different levels does not take
into account the level hierarchy, this must be offered in
future versions of this function.
a list [of lists [of lists [...] ] ] of character (possibly named) vectors or matrices or arrays.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.