Microsoft Small Basic

Program Listing: BRP768
'-----------------------------------------------------------------------------
' Small Basic: Read and Write CSV Files
' http://social.technet.microsoft.com/wiki/contents/articles/20626.small-basic-read-and-write-csv-files.aspx
'-----------------------------------------------------------------------------

' see http://social.technet.microsoft.com/wiki/contents/articles/15062.small-basic-array-basics.aspx
csv = "1=1\=1\;2\=2\;3\=3\;;2=1\=4\;2\=5\;3\=6\;;3=1\=7\;2\=8\;3\=9\;;"
csv_filename = "data.csv"

For line_number = 1 to Array.GetItemCount(csv)
line = csv[line_number][1]

For field_nr = 2 to Array.GetItemCount(csv[line_number])
line = line + "," + csv[line_number][field_nr]
EndFor

' write line to file
' The following line could be harmful and has been automatically commented.
' File.AppendContents(csv_filename, line)
EndFor