How to write multiple .tsv files

  • Thread starter Thread starter junhui.liao
  • Start date Start date
  • Tags Tags
    files Multiple
Click For Summary
SUMMARY

The discussion centers on the challenge of writing multiple .tsv files from a large text file using C++. The user, Junhui, encounters a limitation with the ofstream class, which requires a constant character pointer for the filename, preventing dynamic filename modification. Participants suggest exploring alternative methods, including the ROOT framework, to overcome this limitation and successfully generate multiple output files.

PREREQUISITES
  • Understanding of C++ file handling and the ofstream class
  • Familiarity with .tsv file format and its structure
  • Basic knowledge of the ROOT framework for data processing
  • Experience with string manipulation in C++ for dynamic filename generation
NEXT STEPS
  • Research dynamic filename generation techniques in C++
  • Explore the ROOT framework for file output capabilities
  • Learn about the C++ standard library's filesystem features for file management
  • Investigate alternative libraries for handling .tsv file creation in C++
USEFUL FOR

Developers working with C++ who need to manage file outputs, data scientists utilizing .tsv files for data analysis, and anyone interested in leveraging the ROOT framework for file handling tasks.

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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 2 ·
Replies
2
Views
9K
Replies
10
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
12K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
2
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K