Final project code examples

Randomly helpful code for various things for the final project

Saving a file within repl.it

Add the following line to the top of your file:

let fs = require('fs');

USe the following line instead of console.log to save a variable instead of printing it. In this example, a variable called csv. That’s the variable name we used in our Lab 4 scrapers.

fs.writeFileSync("some_file_name_you_use.csv", csv)

Turning a group of CSV files into a big CSV file

This example is based on using data from the www.thearda.com to calculate the Amish population of specific U.S. coun ties in specific years. (Example uses data from 1890 and 2000.)

Example