I created a script in python which reads excel file and calculate date now i want to execute it with following command:
python your_script.py ./path/to/transactions.csv
My python script file code:
import csv
def csv_data(path):
with open(path) as csv_file:
readCSV = csv.DictReader(csv_file)
for line in readCSV:
col_from = line['from']
col_to = line['to']
col_ammount = line['amount']
from_amount = int(float(col_ammount.lstrip('$').replace(',', ''))) - int(
float(col_ammount.lstrip('$').replace(',', '')))
to_amount = 0 + int(float(col_ammount.lstrip('$').replace(',', '')))
print(col_from, '$'+str(from_amount), col_to, '$'+str(to_amount))
csv_data('transactions.csv')