Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 20

Adding up columns of a comma separated file (CSV)

$
0
0
Here is my method of adding up columns of a comma separated file (CSV)

The .csv file consists of four columns;
Code:
Account,Trans_Date,Interest,Deposit

While the goal is to sum the Interest and Deposit columns, I also do other calculations to create a Total, which I can use from TCC.
Code:
# tfsa.csv = Account,Trans_Date,Interest,Deposit
#
$TFSA = Import-Csv E:\Documents\vfp\tfsa\tfsa.csv
$Total = 0
$TotalInterest = 0
$TotalDeposit = 0

$TheSum = $TFSA | Measure-Object "Interest"...

Read more

Viewing all articles
Browse latest Browse all 20

Trending Articles