Convert a csv file into ROOT format

Hi,

you can use RDataFrame and CSV data source.
This is a more complete example.
Basically, you’ll have to perform the following steps:

auto fileName = "myFile.csv";
auto rdf = ROOT::RDF::MakeCsvDataFrame(fileName);
rdf.Snapshot("myTree", "myFile.root");

Cheers,
D

1 Like