prepare-import-spreadsheet

Create a valid import spreadsheet from different sources

Usage no npm install needed!

<script type="module">
  import prepareImportSpreadsheet from 'https://cdn.skypack.dev/prepare-import-spreadsheet';
</script>

README

prepare-import-spreadsheet

This module reads from a source data and exports it to spreadsheet in order to later be used as import-spreadsheet input. At the time of writing there is a limitation of 5milions cells so if the source has more than 5milion cells (number of rows * number of columns) the export must be performed in steps, for example splitting the source in multiple chuncks and providing for each of them a different spreadsheet url

Commands

from-csv

Read the specified csv file present in the data directory and exports it to spreadsheet, optionally performing a remapping on each row. The provided mapping must be present in the mappings.js module. Check mappings.js tests to see capabilities Export of rows is performed splitting the input in different worksheet due to spreadsheets limitations starting from the worksheet export_0

Usage:

./bin/run from-csv --help

Example:

LOG=debug ./bin/run from-csv -url="https://docs.google.com/spreadsheets/d/1lf6XDwbS3p0t5Af9pKJ26kpH8dOWoHhKpkDYH7aqXgI" -mapping=suning -csv=suning.csv