Leonardo Valentin Zeferino
Posts: 0
Joined: Fri May 29, 2015 2:07 pm

Read csv file in server code

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!

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Read csv file in server code

Hello Leonardo,

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

Return to “Issues”