this is an easier way to work with csv will take csv string or file convert date and time to the formats you wanted also shows how to access each row and cell
Function datefunction2
also check out this topic as it is similar to yours http://www.quickmacros.com/forum/showthr...p?tid=4987
also check http://www.quickmacros.com/help/User/IDP_ICSV.html for more info on ICsv interface
You can access each column in the csv file then use tok to split it further .
need more info where your code is failing to help you further
Function datefunction2
out
//// just for demo purposes
str csv=
;25/4/2018,18:23
;25/4/2018,16:23
;25/4/2018,04:23
/////
out csv
out "------------------------------------------------------------"
;create ICsv variable and load data
ICsv x._create
x.FromString(csv);; comment out or remove this line and use line 15 below to load from a csv file
// also remove lines 4-10
//x.FromFile("path of csv file") load csv data from file
str cell1 cell2
int nr=x.RowCount
int nc=x.ColumnCount
int r c
for r 0 nr ;;for each row
,for c 0 nc ;;for each column
,,if(c=0)
,,,cell1=x.Cell(r c)
,,,DATE d(cell1)
,,,cell1.timeformat("{MM/dd/yyyy}" d)
,,,x.Cell(r c)=cell1
,,else
,,,cell2=x.Cell(r c)
,,,DATE d1(cell2)
,,,cell2.timeformat("{hh:mm tt}" d1)
,,,x.Cell(r c)=cell2
x.ToString(csv);
out csv ;;show CSV
also check out this topic as it is similar to yours http://www.quickmacros.com/forum/showthr...p?tid=4987
also check http://www.quickmacros.com/help/User/IDP_ICSV.html for more info on ICsv interface
You can access each column in the csv file then use tok to split it further .
need more info where your code is failing to help you further