diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-10-31 17:41:19 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-10-31 17:41:19 +0000 |
commit | 7fbc246fbcbfbe819c27d561650aacd312f2d6b0 (patch) | |
tree | 5238ce87303e0951e3aaf8fefc6816b9896d78d4 /Source/SPFieldMapperController.m | |
parent | e3f9028ab739d9e973dd97345605c2abc2a79739 (diff) | |
download | sequelpro-7fbc246fbcbfbe819c27d561650aacd312f2d6b0.tar.gz sequelpro-7fbc246fbcbfbe819c27d561650aacd312f2d6b0.tar.bz2 sequelpro-7fbc246fbcbfbe819c27d561650aacd312f2d6b0.zip |
• CSV import now supports to import sequences of 0 and 1 into BIT fields
• fixed several issues while importing a CSV file if this file contains empty lines or if a line has less columns as header
- fixed issue for matching header names
- fixed issue for user-defined SQL functions while importing; in such a case set the value to @"" to get the defaults
Diffstat (limited to 'Source/SPFieldMapperController.m')
-rw-r--r-- | Source/SPFieldMapperController.m | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index cbaed536..0be1c4d4 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -1370,7 +1370,9 @@ static const NSString *SPTableViewSqlColumnID = @"sql"; CGFloat minDist = 1e6; NSInteger minIndex = 0; for(j=0; j < [fileHeaderNames count]; j++) { - NSString *headerName = [NSArrayObjectAtIndex(fileHeaderNames,j) lowercaseString]; + id fileHeaderName = NSArrayObjectAtIndex(fileHeaderNames,j); + if([fileHeaderName isKindOfClass:[NSNull class]] || [fileHeaderName isSPNotLoaded]) continue; + NSString *headerName = [(NSString*)fileHeaderName lowercaseString]; CGFloat dist = [[NSArrayObjectAtIndex(tableHeaderNames,i) lowercaseString] levenshteinDistanceWithWord:headerName]; if(dist < minDist && ![matchedHeaderNames containsObject:headerName]) { minDist = dist; |