Index: main/waeup.sirp/trunk/tools/fix_import_file.py
===================================================================
--- main/waeup.sirp/trunk/tools/fix_import_file.py	(revision 7517)
+++ main/waeup.sirp/trunk/tools/fix_import_file.py	(revision 7518)
@@ -1,9 +1,5 @@
-##
-## fix_import_file.py
-## Login : <uli@pu.smp.net>
-## Started on  Wed Jan 25 17:08:30 2012 Uli Fouquet
 ## $Id$
 ## 
-## Copyright (C) 2012 Uli Fouquet
+## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -21,5 +17,5 @@
 ##
 """
-Fix exports from old SIRP portal to make them importable by current portal.
+Fix exports from old SRP portal to make them importable by current portal.
 
 Usage:
@@ -28,5 +24,5 @@
 to be in the same directory) and then run
 
-  python fix_import_file.py
+  python fix_import_file.py <filename>
 
 Errors/warnings will be displayed on the shell, the output will be put
@@ -34,12 +30,19 @@
 """
 
+import sys
+
+
+if len(sys.argv) != 2:
+    print 'Usage: python fix_import_file.py <filename>'
+    sys.exit(1)
+
 ##
 ## CONFIGURATION SECTION
 ##
 # file with input data
-INPUT_FILE = 'students_for_reimport.csv'
+INPUT_FILE = '%s' % sys.argv[1]
 
 # file written with modified output
-OUTPUT_FILE = 'out.csv'
+OUTPUT_FILE = '%s_edited.csv' % sys.argv[1].split('.')[0]
 
 # keys are fieldnames in input file, values are methods of class
@@ -56,5 +59,5 @@
 # Mapping input file colnames --> output file colnames
 COLNAME_MAPPING = {
-    'jamb_reg_no': 'reg_no',
+    'jamb_reg_no': 'reg_number',
     'birthday': 'date_of_birth',
     }
@@ -172,3 +175,3 @@
     writer.writerow(row)
 
-print "Ouput written to %s" % OUTPUT_FILE
+print "Output written to %s" % OUTPUT_FILE
