NAME
CSV2root - Converts the given CSV tables into a root file.
SYNOPSIS
CSV2root [Options] Infile1.csv [Options] [Infile2.csv] ...
DESCRIPTION
Reads the given CSV files and creates a root files. Each CSV file will be a tree inside the root file. Each column will be a leaf. Each row an entry. By default the data types of the leaves are selected automatically so, that the information is conserved at less space as possible. The first row in each CSV file has to contain the names of the columns. This row is not considered in finding the data types.
CSV2root 0.2 by Diego Semmler
Usage: CSV2root [Options] Infile1.csv [Options] [Infile2.csv] ...
GLOBAL OPTIONS
These options affect the output file or the behavior of the program and should be only specified once. The position does not matter.
-c | The compression level of the outfile (default: 1) |
-t | The title of the root file (default: "ROOT file") |
-o | Path and/or name of the root file. Default is the first infile with the extension changed to .root. |
-v | Changes the verbosity in different levels from no output except errors (0) to full output (3). (default: 1) |
FILE OPTIONS
These options affect how the input file is read. They must be specified before the input file. Any change of these options affects all following input files until it is overwritten by giving the same option again.
-s |
--separator |
The separator between the columns (default: ";") |
-l |
--lineseparator |
The separator between the rows (default: newline) |
-b |
--buffer |
Size of the root buffer (It is only used for the root file, the CSV file is read at once.) (default: 65536) |
-t |
--treetitle |
Title of the root tree (default: "Created from a .csv file") |
-n |
--name |
Name of the root tree. The default is the name of the infile without extension. |
-i |
--treetitle |
Title of the root tree. The default the string "Created from a .csv file" is used. |
-d |
--datatypes |
Specifies the data-type manually. If only on character is given, all columns will have this data-type. If more than one character is given, each character stands for the data-type of a row. The number of characters should match the number of columns in the file. If this is not the case, a warning is given that surplus data-types or columns will be ignored. With full verbosity (-v 3) a string is printed which can be used as input to the -d option. Possible data-types are:
C | string |
O | boolean |
b | 8 bit integer unsigned |
B | 8 bit integer signed |
s | 16 bit integer unsigned |
S | 16 bit integer signed |
i | 32 bit integer unsigned |
I | 32 bit integer signed |
l | 64 bit integer unsigned |
L | 64 bit integer signed |
F | 32 bit float |
D | 64 bit float |
v | void (The column will be ignored.) |
|
EXAMPLES
CSV2root MyData.csv
Simply converts MyData.csv into a root file.
CSV2root MyData.csv -s , -t MoreData -n MyData2 CommaSeparatedData.csv -o Data.root -c 9 -v 2
Creates a file Data.root with the content of MyData.csv in the tree MyData. The content of CommaSeparatedData.csv is in the tree MyData2 with the title MoreData. Compression factor and verbosity are increased.
BUGS
Please report bugs to the author.
AUTHOR
Diego Semmler |