Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Saving ARRAY Data to CSV File to be used in different macro
#2
Function ArrayToCsvFile_str1d
Code:
Copy      Help
;/
function ARRAY(str)&a $_file

;Saves 1-dim str array to CSV file.


opt noerrorshere 1
ICsv x._create
for(_i 0 a.len) x.AddRowSA(-1 1 &a[_i])
x.ToFile(_file)
Function ArrayToCsvFile_str2d
Code:
Copy      Help
;/
function ARRAY(str)&a $_file

;Saves 2-dim str array to CSV file.


opt noerrorshere 1
ICsv x._create
x.FromArray(a)
x.ToFile(_file)
Function ArrayFromCsvFile_str1d
Code:
Copy      Help
;/
function ARRAY(str)&a $_file

;Loads 1-dim str array from CSV file.


opt noerrorshere 1
ICsv x._create
x.FromFile(_file)
a.create(x.RowCount)
for(_i 0 a.len) a[_i]=x.Cell(_i 0)
Function ArrayFromCsvFile_str2d
Code:
Copy      Help
;/
function ARRAY(str)&a $_file

;Loads 2-dim str array from CSV file.


opt noerrorshere 1
ICsv x._create
x.FromFile(_file)
x.ToArray(a)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)