coston / json-to-csv-export

A function to easily generate csv downloads of your json data. ✨
https://json-to-csv-export.coston.io
MIT License
84 stars 24 forks source link

Adding sep= to the top of file to help with opening csv files #50

Closed mathijsfr closed 3 months ago

mathijsfr commented 1 year ago

When adding a delimitter as follows:

const dataToConvert = {
    data: result,
    filename: `${props.name}.csv`,
    delimiter: ';',
    headers: Object.keys(result[0])
  }

The delimitter should be added at the top of the file to help with opening it.

image

mathijsfr commented 1 year ago

51

coston commented 1 year ago

Hey @mathijsfr, thank you for the pull request and opening this issue. The solution here causes some compatibility issues with basic csv views (non-excel.) See the image below of when one opens the csv with Apple Numbers.

image