How can I convert .txt file to .root file

There is several example in this forum.
For instance: Time axis while reading from external file