Export Arrays to CSV Files and Vice Versa

Lists, Collections and Arrays
Peter Wester

Version Compatibility: Visual Basic 6

More information:
SaveArrayAsCSVFile.bas contains:

- subroutine 'SaveAsCSV' to export an array (as double) to a csv file.

' Syntax:
' SaveAsCSV dMyArray, sMyFileName, [sMyDelimiter]

- function ImportCSVinArray to import a csv file into an array (as double).
' Syntax:
' dMyArray() = ImportCSVinArray (sMyFileName, [sMyDelimiter])
The module is shown in the demo that will create c:\temp\demo.csv from an array, and will import that file into an array. To see the latter, break the application and call the content of array dChrom.

Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download saveascsv.zip