summaryrefslogtreecommitdiffstats
path: root/contrib/csvpricesqif.py
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2023-01-20 22:26:39 +0100
committerSlávek Banko <slavek.banko@axis.cz>2023-01-20 22:26:39 +0100
commitd09e55dfbb793fc01c18d82eacbc59d6056a9390 (patch)
treed1ffb53838cc16a1eaa22dcf43044f6d06971ad7 /contrib/csvpricesqif.py
parent08ab6ec214e63d1924c8e6764622322edb90bbd5 (diff)
downloadkmymoney-r14.1.0.tar.gz
kmymoney-r14.1.0.zip
Drop python2 support.r14.1.0
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'contrib/csvpricesqif.py')
-rwxr-xr-xcontrib/csvpricesqif.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/csvpricesqif.py b/contrib/csvpricesqif.py
index 656ce20..a91dd6b 100755
--- a/contrib/csvpricesqif.py
+++ b/contrib/csvpricesqif.py
@@ -21,15 +21,15 @@
import csv
-# *** NOTE ***
+# *** NOTE ***
# It may be necessary to remove the second line, before running.
-# Simple script to convert a csv format Prices file, as from later
+# Simple script to convert a csv format Prices file, as from later
# editions of Quicken, to qif format for KMyMoney2.
# It and its data files are expected to be in the same directory.
# First make the script executable:- chmod u+x csvpricesqif.py
# Run by ''./csvpricesqif.py' .
-# You will be prompted to enter input and output filenames, followed
+# You will be prompted to enter input and output filenames, followed
# by the symbol for the stock.
# Input format - "23.12.09","61.62",,,
@@ -38,21 +38,21 @@ import csv
# "HJU8.BE",61.62,"23.12.09"
# ^
-fin = raw_input('Please enter the input Prices filename (.csv, .PRN, etc.) : ')
-fout = raw_input('Please enter the output filename (add .qif) : ')
-symbol = raw_input('Please enter the symbol for this stock: ')
+fin = input('Please enter the input Prices filename (.csv, .PRN, etc.) : ')
+fout = input('Please enter the output filename (add .qif) : ')
+symbol = input('Please enter the symbol for this stock: ')
symbol ='"'+ symbol+'"'# Add " " around symbol
inputfile = csv.reader(open(fin, 'rb'))
outputfile = open(fout, 'w')
-inputfile.next() # Skip header line. Comment out if no header.
+next(inputfile) # Skip header line. Comment out if no header.
inputfile_list = []
inputfile_list.extend(inputfile)
for data in inputfile_list:
line = '!Type:Prices\n'
line = line +symbol +',' + data[1] + ',"' + data[0] + '"\n' + '^\n'
-
+
#print line
outputfile.write(line)