Uploading and reading csv file through angularjs

677 views
Skip to first unread message

Durgesh pandey

unread,
Feb 24, 2017, 12:38:36 PM2/24/17
to Angular and AngularJS discussion
Hi all,

     Please provide the sample example to read and write the csv file with the help of angular js.

Sander Elias

unread,
Feb 25, 2017, 1:50:58 AM2/25/17
to Angular and AngularJS discussion
Hi Durgesh,

There is nothing Angular involved by parsing a css file. (aside from using $http to get the file.)

$http.get('/pathToMyCSVFile.csv')
   
.then((result) => result.data)
   
.then((csv) => csv.split("/n").map( row => row.split(",")))
   
.then(arrayOfArrays => /* do something */)


Regards
Sander
Reply all
Reply to author
Forward
0 new messages