CSV in one formula
/0 Comments/in Blog/by Peter ClarkIn an earlier blog post I discussed how PersisTables simplifies the creation of a CSV file. In the post I created a Table and then used the TKTable_Save() function to save it away.
One of the powerful features of PersisTables is that a Table and an Excel Range are interchangeable. So any function that accepts a Table Handle as input can also accept a Range of cells. This means that a CSV file can be created in one function.

The Range highlighted is saved directly as a csv file named “powers” in the FastSave Genre.
Similarly a file can be loaded and displayed in a single formula. Normally we enter the TKTable_Load() formula in a single cell and get a Table Handle back.

However wrapping the function in the TKTable_Get() function and turning the results into an Array formula we can display the whole Table immediately.

Using the Fill argument in TKTable_Get() allows the ugly #N/A to be replaced by an empty string or other suitable characters.

