Question
Help with script I'm testing and I 'd like to understand issue
Hi,
I write a little script and have issue can't find solution :
The script read a csv file with comma separate, and I try to store individual values in a array but I have undefined value in my array. Here is my script :
var ref = File.openDialog("Please open csv file separate with comma :");
var cur = []; // my Array for import data
ref.open("r");
var temp = ref.readln();
var cur2 = temp.split(","); // Splitting the file
alert("Have found : "+ cur2.length+" datas");
alert("Here is what I found : "+cur2);
while ( !ref.eof ) { // Here I try to put datas on array but it doesn't work...
cur[ cur.length ] = ref.readln();
}
ref.close();
for (var i = 0; i < cur2.length; i++){ // Loop to see what's happen....
result = cur[i]
alert("cur = ["+i+"] have this :" + result +" ...and in var cur2 have this : " +cur2[i]);
};
alert("That's all !");Thanks in advance,
Christian
