Writing a TVirtualTable to a CSV file
Posted: Thu 21 Jul 2016 16:03
Hi,
I have an application that creates very large datasets (e.g., 700,000 records). I'm creating and storing the data in a TVirtualTable, but then I need to output this to a CSV file. The way I attempted to do this was go through each record in the table, convert it to a comma separated string and add it to a TStringList so I could use the TStringList.SaveToStream method to efficiently write to a file. The problem I'm running into is that I run out of memory trying to populate the TStringlist. Do you have any suggestions for a better way to go from a TVirtualTable to a CSV?
Thanks!
SDE
I have an application that creates very large datasets (e.g., 700,000 records). I'm creating and storing the data in a TVirtualTable, but then I need to output this to a CSV file. The way I attempted to do this was go through each record in the table, convert it to a comma separated string and add it to a TStringList so I could use the TStringList.SaveToStream method to efficiently write to a file. The problem I'm running into is that I run out of memory trying to populate the TStringlist. Do you have any suggestions for a better way to go from a TVirtualTable to a CSV?
Thanks!
SDE