Week 6

Scourgify

Read a CSV, split a combined name into two columns, and write a new CSV.

You type

An input file name and an output file name.

The tool
Two file names 0 scourgify.py 1 input.csv 2 output.csv
What comes out

A new file. The wrong arguments stop the program.

The question, more slowly

The question is: read one CSV and write another. The input has a combined name in one column. The output has the first name and the last name in separate columns, plus the house. You are given the input and output file names on the command line.

Split the combined name on the comma. Watch the space after the comma. Write a header row, then one row per person. The spec shows both files.

People swap first and last, because the input is 'last, first'. Read one sample row out loud before you assign the variables.

Before you code

Take one combined name from the spec's sample file and split it into first and last on paper.