Question was to modify the code in the last lesson, where
- the comma could be replaced by tab, for making it easy to read
- to add the columns and show the total.
In the following code, it takes two parameters, first is csv file, and second is col. The same old file is used. The csv file first
C:\scripts\file-io>type sample.csv |
The output of the program
C:\scripts\file-io>03-addcols-csv.vbs sample.csv 4 //nologo Sum of Col 4 is 2121 |
And finally the code
Const ReadMode=1 |
What more can be done.
a. You can validate if the column selected exists and if it does exists is it a numeric value.
b. You can check if the csv file passed as a parameter exists in the first place.
No comments:
Post a Comment