tsvGenIndex {tsvio}R Documentation

Produce a simple index of a tsv file.

Description

This function reads a TSV file and produces an index to the start of each row. The TSV file is required to have a header line and at least one data line. The header line may contain either the same number or one fewer columns than the data lines, which must all contain the same number of columns. The first column of each data line will be indexed.

Usage

tsvGenIndex(filename, indexfile)

Arguments

filename

The name (and path) of the file(s) containing the data to index.

indexfile

The name (and path) of the file(s) to which the index will be written. There must be exactly one index file for every filename.

Value

NULL. This function generates an index file.

See Also

tsvGetLines, tsvGetData

Examples

datafile = tempfile("data");
df <- data.frame(C1 = c("Foo", "Boing", "The"), C2 = c("Bar", "Boing", "End"));
rownames(df) <- c("R1", "R2", "R3");
write.table(df, file=datafile, sep="\t", quote=FALSE, row.names=TRUE, col.names=TRUE);
indexfile = tempfile("index");
tsvGenIndex (datafile, indexfile)


[Package tsvio version 1.0.6 Index]