File Names to CSV



One major part of this project has been how to collect all the data and format it to create items and collections. This Node script I created parses file names to CSV format. This will allow me to create records for all digital items. This script will add a unique id, a title, and a boolean value for own for each file within the folder.

Steps

  • run: npm install
  • run: node FileNameParser.js files
  • out.csv is the output

To add more columns simply add on to header and add the values within the foreach statement.

Here is an example of the output.

This stackoverflow was great at showing multiple options on how to pass arguments to the Node script

The UUID Package generates a unique id for each item, however this could be replaced with any form of a unique id.