How to convert window log csv file to .root file


Please read tips for efficient and successful posting and posting code

_ROOT Version: 6.22.06
_Platform: ubuntu 20.04
_Compiler: GNU g++


Hi Everyone,
I need to do analytics on windows log file which is in .csv format. csv file is around 900mb on disk so i want to convert it into .root file for efficient storage of my data on disk. kindly do assist me in do so with c++.

With Regards,
Mohan

Welcome to the ROOT forum! It depends on what is in your CSV file, really. Did you try to search this forum to see if there is a topic matching what you’re asking for? (there are quite a few topic about csv to root already…)

Hi Bellenot,
Thank you so much for replying on my post. Happy Christmas in advance.
ROOT have MakeCsvDataFrame() were i can convert csv file to RDataFrame. Now i want to convert this RDataFrame to .root file. i got stuck at that point. ya i started to surf some of solutions in forum. if you find some links on it kindly do share those links to me. It will help for me.
Windows log csv file contains all users login activities and it contains lots of timestamps.
While i started to root document i get to know we have to create TTree.
Am not getting good example codes were i could those in my task on RDataFrame if you find some link kindly do share the same

Maybe @eguiraud can give more details, but I think RDataFrame::Snapshot() is what you’re looking for. You can also read the ROOT::RDataFrame Class Reference

1 Like

Thank for your valuable information @bellenot.

1 Like

Hi,
you can find several RDF tutorials at https://root.cern/doc/master/group__tutorial__dataframe.html, and as Bertrand mentioned you should look at Snapshot for saving the data read with RDF as a TTree (i.e. in a ROOT file). df007_snapshot.C, for example, shows how to use Snapshot.

Cheers,
Enrico