vuetify-parser-xlsx-csv
A simple Vuetify based module that extracts data from .csv, .xlsx, .xls files in the form of a JSON. It uses the xlsx module to parse the file. Be sure to check it out.
Installation
npm install vuetify-parser-xlsx-csv
Working
The module ask for a file input, and then asks you to choose your labels for the columns in the file. After that is done, you will receive the results in the form of a JSON. Check the usage section for a detailed example.
Usage
This is a simple example using the module to display a demo .xlsx file.
Data
Here's where the data looks like.
First Name | Last Name | Phone | |
---|---|---|---|
John | Doe | johndoe@example.com | 123 456 8790 |
Alan | Shepard | commandershepard@example.com | 456 879 1230 |
Carl | Johnson | carljohnson@example.com | 789 456 1230 |
Leon | Kennedy | leonkennedy@example.com | 123 879 4560 |
Code
And here's the code.
File Upload {{col.label}} {{ row[col.key] }}
JSON Format
The JSON is stored in results, and each row of the file is a separate element.
"firstname": "John" "lastname": "Doe" "email": "johndoe@example.com" "mobile": "123 456 8790" "firstname": "Alan" "lastname": "Shepard" "email": "commandershepard@example.com" "mobile": "456 879 1230" "firstname": "Carl" "lastname": "Johnson" "email": "carljohnson@example.com" "mobile": "789 456 1230" "firstname": "Leon" "lastname": "Kennedy" "email": "leonkennedy@example.com" "mobile": "123 879 4560"