Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSV example: load, get cell, set cell, save
#2
Macro Macro2448
Code:
Copy      Help
;a CSV string for testing
str csv=
;Doe | John | 39 | M
;Doe | Jane | 38 | F

;create ICsv variable and load data
ICsv x._create
x.Separator="|" ;;change separator (default is ",")
x.FromString(csv) ;;or x.FromFile("C:\CVSdb\file.cvs")

;get a cell
str cell
cell=x.Cell(1 1) ;;0-based row and column (Jane)
out F"cell 1 1 was: {cell}"

;change cell
cell="Susan"
x.Cell(1 1)=cell

;get CSV data to string
x.ToString(csv) ;;or x.ToFile("C:\CVSdb\file.cvs")

;results
out "changed CSV:"
out csv


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)