Exercise: Add numbers taken from a CSV file

See other exercises.

Given a CSV file like this:

examples/data/process_csv_file.csv

Tudor;Vidor;10;Hapci
Szundi;Morgo;7;Szende
Kuka;Hofeherke;100;Kiralyno
Boszorkany;Herceg;9;Meselo

Write a script that will take the values of the 3rd in this Comma Separated Values file and add them together.

Can your code also handle this file?

examples/data/distance.csv

Budapest,Bukarest,1200,km
Tel Aviv,Beirut,500,km
London,Dublin,300,km
New York,"Moscow, East",6000,km
Local,"Remote
Location",10,km

Tools

Solutions in Perl 5

Solution Ruby