Page 1 of 1

Saving and loading Grid data to/from a file

Posted: Wed Jan 10, 2018 12:22 am
by 18682751
Hi
How I can I save/load data to/from a TAB separated text file or a CSV file?

Is there an easy way to transpose the grid so that rows become columns and columns become rows?
BR
emwamin

Re: Saving and loading Grid data to/from a file

Posted: Wed Jan 10, 2018 9:03 am
by yeray
Hello,

To Save you can:
- Call TeeGrid1.Grid.Copy method to copy the data into the Clipboard. Paste it into a new text file. Save it as a .csv. Note this method gives comma-separated output.
- Use TCSVData.From from Tee.Grid.CSV unit to generate a string from the data in the grid. Note the TCSVData.From method allows you to modify the separator being used. Then, you can save that string into a .csv file.

To Load you can:
- Manually read the .csv file and create the Data from it.

Alternatively, you can Import and Export using TeeBI.