Changeset 686 for trunk


Ignore:
Timestamp:
May 30, 2009, 11:31:54 AM (11 years ago)
Author:
sheldon
Message:

Switch split to use regexes and split on ' +' rather than single space, no need to double space replacement, fixes problem with lines with 3 spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/npemap.org.uk/scripts/generic-python-import/generic_importer.py

    r671 r686  
    298298                        return
    299299
    300                 # Replace double spaces
    301                 line = line.replace("  "," ")
    302 
    303                 parts = line.split(" ")
     300                parts = re.split(" +", line)
    304301                if not len(parts) == 4:
    305302                        print "Invalid line '%s'" % line
Note: See TracChangeset for help on using the changeset viewer.