Executing the program

The program is executed by executing the output file (.exe in  Windows) and passing two command-line arguments, namely the CSV filename and column number.

The files are organized (in my case) as shown in the following screenshot:

Run the program using the following command:

./CSV.exe books.csv 1
The executable name might change slightly with different operating systems and different terminal or command prompts. It will also be different if you specify a different name for the output file when compiling.

It shows the following output:

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.