2 years ago

#41355

test-img

jake clark

how to avoid double quotes for numbers in CSV papaparse

My below configuration will add double quotes for all the data, but I want to avoid double quotes for "Numbers" and "Date" type data, how can I do that.

   const universalBOM = "\uFEFF";
   const link = document.createElement("a");   

link.setAttribute("href", 'data:text/csv; charset=utf-8,' + encodeURIComponent(universalBOM + csvParser.unparse(newArr,{
  quotes: true,
  quoteChar: '"',
  escapeChar: '"',
  delimiter: ',',
  header: true,
  newline: '\r\n',
  skipEmptyLines: false,
  columns: null
})));

reactjs

papaparse

0 Answers

Your Answer

Accepted video resources