Page 1 of 1

Read csv file in server code

Posted: Fri Aug 07, 2015 1:02 am
by Leonardo Valentin Zeferino

Hi!

I'm trying to read a csv file and transform it in array[j] in server code without success.
Please, do you have any example how I can do this?

I read the file but I don't know how to split in array.

code
var responseBody = {},
requestParams = {},
paramKeys = request.keys();
for (var key = 0; key < paramKeys&#46;length; key++) {
requestParams[paramKeys[key]] = request&#46;get(paramKeys[key]);
}
&#47;&#47;Note you need to change site url here&#46;
var siteUrl = "http:&#47;&#47;www&#46;leozeferino&#46;com&#46;br/coffeely/mapeamento/import/teste2&#46;csv&quot
var requestBody = "&quot
var XHRResponse = XHR&#46;send("GET", siteUrl,
{
"status": "sent",
"headers": {
},
body: requestBody
}
);
console&#46;log(XHRResponse);
console&#46;log(XHRResponse&#46;body);
responseBody = XHRResponse&#46;body;
/code

Thanks!


Read csv file in server code

Posted: Fri Aug 07, 2015 4:31 pm
by Serhii Kulibaba

Hello Leonardo,

Please follow this topic: http://stackoverflow.com/questions/74...