How to write multiple .tsv files

  • Thread starter Thread starter junhui.liao
  • Start date Start date
  • Tags Tags
    files Multiple
AI Thread Summary
The discussion centers on the challenge of reading from a large text file and writing its contents into multiple smaller TSV files in C++. The user, Junhui, is facing a limitation with the `ofstream` class, which requires a constant character pointer for the filename, making it difficult to modify the filename for multiple output files. The user is seeking solutions or alternative approaches, including those based on ROOT, to overcome this issue.
junhui.liao
Messages
6
Reaction score
0
Hi, guys,

I have to read from a big txt file into multiple small .tsv files.
But I was blocked at the file name. Since according to the
definition of ofstream, the filename is constant char *, then
is no way to modify the filename, which results in unable to
write multiple files.

Does anybody has any idea on this ?

Thanks a lot in advance !

Best !

Junhui
 
Technology news on Phys.org
my code in C++, sorry for the missing.
If there is any solution based on ROOT,
it's good also.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top