on 2022 Dec 02 11:46 PM
Dear Community,
I just started working with appgyver and i faced an issue while trying to convert Excel file data to data that can be stored on internal device storage.
I used the Pick files flow function to choose the Excel file from my internal storage and read file to get the file string.
How can i use this string file and transform it to data i can store in my device's internal storage ?
Thank you for your help.
Best regards,
Marouane
Request clarification before answering.
Dear Daniel,
I'm not really familiar with Javascript, could you please give me some guidance.
The Js code i used is :
function csvJSON(input1) { const lines = input1.split("\n"); const result = []; const headers = lines[0].split(","); for (let i = 1; i < lines.length; i++) { //if (!lines[i]) //continue const obj = {}; const currentline = lines[i].split(","); for (let j = 0; j < headers.length; j++) { obj[headers[j]] = currentline[j]; }; result.push(obj); }; return JSON.stringify(result);};This code seems to be OK but still i don't have a result.I want to mention that the input is an UTF8 file string and the output is a list of objects with 2 properties.Thank you so much for your help.Best regards,MarouaneYou must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
47 | |
9 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.