Changeset 7518
- Timestamp:
- 27 Jan 2012, 06:54:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/tools/fix_import_file.py
-
Property
svn:keywords
set to
Id
r7516 r7518 1 ##2 ## fix_import_file.py3 ## Login : <uli@pu.smp.net>4 ## Started on Wed Jan 25 17:08:30 2012 Uli Fouquet5 1 ## $Id$ 6 2 ## 7 ## Copyright (C) 2012 Uli Fouquet 3 ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann 8 4 ## This program is free software; you can redistribute it and/or modify 9 5 ## it under the terms of the GNU General Public License as published by … … 21 17 ## 22 18 """ 23 Fix exports from old S IRP portal to make them importable by current portal.19 Fix exports from old SRP portal to make them importable by current portal. 24 20 25 21 Usage: … … 28 24 to be in the same directory) and then run 29 25 30 python fix_import_file.py 26 python fix_import_file.py <filename> 31 27 32 28 Errors/warnings will be displayed on the shell, the output will be put … … 34 30 """ 35 31 32 import sys 33 34 35 if len(sys.argv) != 2: 36 print 'Usage: python fix_import_file.py <filename>' 37 sys.exit(1) 38 36 39 ## 37 40 ## CONFIGURATION SECTION 38 41 ## 39 42 # file with input data 40 INPUT_FILE = ' students_for_reimport.csv'43 INPUT_FILE = '%s' % sys.argv[1] 41 44 42 45 # file written with modified output 43 OUTPUT_FILE = ' out.csv'46 OUTPUT_FILE = '%s_edited.csv' % sys.argv[1].split('.')[0] 44 47 45 48 # keys are fieldnames in input file, values are methods of class … … 56 59 # Mapping input file colnames --> output file colnames 57 60 COLNAME_MAPPING = { 58 'jamb_reg_no': 'reg_n o',61 'jamb_reg_no': 'reg_number', 59 62 'birthday': 'date_of_birth', 60 63 } … … 172 175 writer.writerow(row) 173 176 174 print "Ou put written to %s" % OUTPUT_FILE177 print "Output written to %s" % OUTPUT_FILE -
Property
svn:keywords
set to
Note: See TracChangeset for help on using the changeset viewer.