Answer the question
In order to leave comments, you need to log in
What is the best way to create files?
I am writing a parser with saving information in csv.
The final file is 3-4 thousand lines, how is it more efficient to save information in one piece after the work is completed or lines of 50-100 in the process?
In terms of job stability?
Answer the question
In order to leave comments, you need to log in
If it is not possible to continue from the place where it fell, it does not matter. If there is - naturally line by line.
I would keep it together. 3-4 thousand lines is how much, 150KB? Even if it is 300KB, there is no problem to keep such a volume in memory without being distracted by dumping it to a file, and then saving it all at once.
The parsing process takes, perhaps, a second at most? Don't bother, save the results when you're done.
PS, of course, you should correctly arrange the processing of exceptions, if they are possible.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question