When I created the new array and assigned an element to it, that didn't split anything up. You've probably already guessed the problem. Naturally, my first thought was to make each element its own array so I could access the fields as elements within the new array. That sounded a lot like accessing elements in an array, except I wasn't dealing with an array but an element in an array. My problem was that I needed to access the individual fields within the records. (You'll notice my code is slightly different regarding the separators I used.) Once the string is appropriately split, the code then uses nested for loops to first split each record and then store each record as an element of an array. Mounir Messelmeni's processData(csv) method takes the csv file you select as an argument and stores it in a variable as a string using split(). We'll start with how the code to upload the csv file works. Once the csv file was uploaded, my goal was to select certain rows and then, from those rows, select certain fields to display. (Just make sure you have appropriate code to display it since the author just uses console.log.) Uploading the csv file was the easy part thanks to this code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |