Filewrite to csv and fileread to array from csv

Back to topics list To post a new topic, please log in or register
avatar
7
fxchess 2015.03.04 08:11
 

does any one can help me to do 

i have two array , array A & array B 

if i want to save array A data to csv then read from csv and to write to array B

how can i code it,thank you!

that is my code blow 

thank you! 

"writefile"
handle=FileOpen(filename,FILE_CSV|FILE_READ|FILE_WRITE);
     
     FileWrite(handle,EntryTrade[0],TimeToStr(EntryTrade[1],TIME_DATE|TIME_SECONDS),EntryTrade[2],EntryTrade[3],EntryTrade[4],EntryTrade[5]
     ,EntryTrade[6],EntryTrade[7],EntryTrade[8],EntryTrade[9],EntryTrade[10],EntryTrade[11],EntryTrade[12],EntryTrade[13]);
     FileClose(handle);


"readfile"

handle=FileOpen(filename,FILE_CSV|FILE_READ);
     FileReadArray(handle,HoldingOrder,0,WHOLE_ARRAY);
     FileClose(handle);
avatar
112
sangmane 2015.03.06 22:54 #
 
handle=FileOpen(filename,FILE_CSV|FILE_READ); 

string holdingArray[14];

for (int i=0; i<ArraySize(holdingArray); i++) {

        holdingArray[i] = FileReadString(handle);

        if (FileIsEnding(handle)) break;

}

FileClose(handle); 
Back to topics list  

To add comments, please log in or register