Question: Create node project name Lab01_ StudentID_COMP3133 Add required modules to the project npm install --save csv-parser Download given input_countries.csv file to read data and perform
- Create node project name Lab01_ StudentID_COMP3133
- Add required modules to the project
npm install --save csv-parser
- Download given input_countries.csv file to read data and perform following task
- Delete canada.txt and usa.txt if already exist using fs module
- Filter data of Canada and write data to canada.txt
- Filter data of United States and write data to usa.txt
- Create node project name Lab01_ StudentID_COMP3133
- Add required modules to the project
npm install --save csv-parser
- Download given input_countries.csv file to read data and perform following task
- Delete canada.txt and usa.txt if already exist using fs module
- Filter data of Canada and write data to canada.txt
- Filter data of United States and write data to usa.txt
Sample Output of canada.txt file
country,year,population
canada,1985,23456778
canada,1986,23457589
********************
input_countries.csv file is pasted below
| country | year | population |
| Afghanistan | 1952 | 8425333 |
| Afghanistan | 1957 | 9240934 |
| Afghanistan | 1962 | 10267083 |
| Afghanistan | 1967 | 11537966 |
| Afghanistan | 1972 | 13079460 |
| Afghanistan | 1977 | 14880372 |
| Afghanistan | 1982 | 12881816 |
| Afghanistan | 1987 | 13867957 |
| Afghanistan | 1992 | 16317921 |
| Afghanistan | 1997 | 22227415 |
| Afghanistan | 2002 | 25268405 |
| Afghanistan | 2007 | 31889923 |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
