How to Convert Deceased list data to JSON format
Here's how:
-
In the 1990's the Ames High School Alumni Association started tracking all deceased alumni and some teachers. The data was and is still stored in File Maker Pro (I know, I know). The format of the data I get is a CSV comma seperated value file. I then convert said file to a file seperated by ^ carot symbols and then upload to the appropriate designated folder on the server. That file, deceased.dat is then processed by a few PERL scripts. Remember, this was originally from the 90's and PERL was the bomb back then.
-
Now, fast forward to 2022. I want to convert this file to a JSON file and put it in the _data folder and use it as 11ty data and a collection.
Website used to convert from CSV to JSON
- open the CSV file in libre office and add a header to the top line of the spreadsheet and save as a csv file.
https://www.convertcsv.com/csv-to-json.htm
- Choose the INPUT file: deceased.csv
- thru step 4) optional
- step 5 click CSV to JSON tab and this is what the output looks like:
[ { "AHSAAID": 85901, "Year": "1000", "Last": "Abbott", "First": "Clair", "Middle": "", "HSLast": "Abbott", "HSFirst": "Clair", "HSMiddle": "", "Birth": "3-31-1917", "DOD": "March 11, 1998", "Place": "Boone, Iowa", "Reference": "" }, { "AHSAAID": 88701, "Year": "1000", "Last": "Acuff", "First": "Hoyt", "Middle": "", "HSLast": "Acuff", "HSFirst": "Hoyt", "HSMiddle": "", "Birth": "12-2-1925", "DOD": "5-10-2015", "Place": "AMES, IOWA", "Reference": "AMES TRIBUNE 5-12-2015" } ] ### Add module.exports = [ beginning of JSON File
Add module.exports = [ as the first line in this new deceased.js file and move to the _data directory. I will show you how to use this file in the next few blog posts when I figure out how myself. ;-)
module.exports = [ { "AHSAAID": 85901, "Year": "1000", "Last": "Abbott", "First": "Clair", "Middle": "", "HSLast": "Abbott", "HSFirst": "Clair", "HSMiddle": "", "Birth": "3-31-1917", "DOD": "March 11, 1998", "Place": "Boone, Iowa", "Reference": "" }, { "AHSAAID": 88701, "Year": "1000", "Last": "Acuff", "First": "Hoyt", "Middle": "", "HSLast": "Acuff", "HSFirst": "Hoyt", "HSMiddle": "", "Birth": "12-2-1925", "DOD": "5-10-2015", "Place": "AMES, IOWA", "Reference": "AMES TRIBUNE 5-12-2015" } ]