File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1010#import " CSVDocument.h"
1111#import " CSVRowObject.h"
1212
13+ #define AUTODETECT_NUM_FIRST_CHARS 1000
14+
1315
1416@implementation CSVDocument
1517
@@ -58,11 +60,11 @@ - (NSUInteger) numRowsFromCSVString:(NSString *)string maxRows:(NSUInteger)maxRo
5860 NSMutableArray *thisRows = [NSMutableArray array ];
5961 NSMutableArray *thisColumnKeys = [NSMutableArray array ];
6062
61- // Check whether the file uses ";" or TAB as separator by comparing relative occurrences in the first 200 chars
63+ // Check whether the file uses ";" or TAB as separator by comparing relative occurrences in the first AUTODETECT_NUM_FIRST_CHARS chars
6264 if (autoDetectSeparator) {
6365 self.separator = @" ," ;
6466
65- NSUInteger testStringLength = ([string length ] > 200 ) ? 200 : [string length ];
67+ NSUInteger testStringLength = ([string length ] > AUTODETECT_NUM_FIRST_CHARS ) ? AUTODETECT_NUM_FIRST_CHARS : [string length ];
6668 NSString *testString = [string substringToIndex: testStringLength];
6769 NSArray *possSeparators = [NSArray arrayWithObjects: @" ;" , @" " , @" |" , nil ];
6870
You can’t perform that action at this time.
0 commit comments