- App to open a locally-stored Comma Separated Values (CSV) file and allow it to be modified and saved/shared via a social media plugin if using a mobile or as a xls file if using a PC.
- This is another great tutorial from Simon Grimm of the IonicAcademy - see 👏 Inspiration below.
- Note: to open web links in a new window use: ctrl+click on link
- Includes 'export' button top left to save the file to social media etc.
- The Cordova-plugin-file plugin implements a File API allowing read/write access to files stored on the device.
- The cordova-plugin-x-socialsharing shares text, files, images and links via social networks, sms and email.
- Ionic v6
- Ionic/angular v6
- Angular v15
- cordova-plugin-file v7
- cordova-plugin-x-socialsharing v6
- mholt: Fast and powerful CSV (delimited text) parser - github link
- ngx-papaparse v6 & Albert Haff website
- To start the server on localhost://8100 type: 'ionic serve'
- To start the server on a mobile using Ionic devapp and connected via wifi, type: 'ionic serve --devapp'
- The Ionic DevApp was installed on an Android device from the Google Play app store.
- code from Cordova plugin to open a file on a mobile device file system with its default application
// parse data asynchronously as per papa parse documentation.
this.papa.parse(csvData, {
complete: parsedData => {
this.headerRow = parsedData.data.splice(0, 1)[0];
this.csvData = parsedData.data;
console.log('data array: ', this.csvData);
}
});
- CSV file access and editing.
- Status: Working. Tested using Ionic server and Ionic devapp. Passes linting.
- To-do: nothing
- Simon Grimm IonicAcademy Youtube video 'Ionic Native File Explorer'
- Written version of tutorial from Devtactic website: How to Import & Export CSV Data using Papa Parse with Ionic
- This project is licensed under the terms of the MIT license.
- Repo created by ABateman, email: gomezbateman@yahoo.com