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 10
10
#import " CSVDocument.h"
11
11
#import " CSVRowObject.h"
12
12
13
+ #define AUTODETECT_NUM_FIRST_CHARS 1000
14
+
13
15
14
16
@implementation CSVDocument
15
17
@@ -58,11 +60,11 @@ - (NSUInteger) numRowsFromCSVString:(NSString *)string maxRows:(NSUInteger)maxRo
58
60
NSMutableArray *thisRows = [NSMutableArray array ];
59
61
NSMutableArray *thisColumnKeys = [NSMutableArray array ];
60
62
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
62
64
if (autoDetectSeparator) {
63
65
self.separator = @" ," ;
64
66
65
- NSUInteger testStringLength = ([string length ] > 200 ) ? 200 : [string length ];
67
+ NSUInteger testStringLength = ([string length ] > AUTODETECT_NUM_FIRST_CHARS ) ? AUTODETECT_NUM_FIRST_CHARS : [string length ];
66
68
NSString *testString = [string substringToIndex: testStringLength];
67
69
NSArray *possSeparators = [NSArray arrayWithObjects: @" ;" , @" " , @" |" , nil ];
68
70
You can’t perform that action at this time.
0 commit comments