Print TB to .csv

I am a new TB user and am having trouble creating a .csv file and exporting results to that file. Any help would be much appreciated!

Comments

Write to CSV example


PRINT "Print DATA To CSV File"
PRINT "Jovan Trujillo 5/26/2017"
PRINT "Using True BASIC Bronze version 6.007"
LET ncols = 4
LET nrows = 4
LET filename$ = "data.csv"
LET dataline$ = ""
PRINT "Creating data file data.csv..."
OPEN #1: NAME filename$, CREATE NEWOLD
ERASE #1
FOR i = 1 TO 4
FOR j = 1 TO 4
READ data
IF j=4 THEN
LET dataline$ = dataline$ & STR$(data)
ELSE
LET dataline$ = dataline$ & STR$(data) & ","
END IF
NEXT j
PRINT #1:dataline$
LET dataline$ = ""
NEXT i
PRINT "Done writing data to data.csv."
DATA 1,2,3,4
DATA 5,6,7,8
DATA 9,10,11,12
DATA 3,14,15,16
END

How to Print TB to .csv

Hi Blaine,

All a ".csv" file is, is an array of nrow rows of ncol columns each, the data in each column being separated by a delimiter, usually a comma, but can be almost anything.

I have a SUB which I use for saving arrays, and if you email me with the subject "Saving an Array" I can send you an example program demonstrating it.

Posting code on this forum is tedious due to the use of HTML, and it also destroys the formatting, making the code difficult to read.

Regards, Mike C.