|
49 | 49 |
|
50 | 50 | % ------
|
51 | 51 | % Author: David Legland
|
52 |
| -% e-mail: david.legland@inra.fr |
| 52 | +% e-mail: david.legland@inrae.fr |
53 | 53 | % Created: 2010-08-05, using Matlab 7.9.0.529 (R2009b)
|
54 | 54 | % Copyright 2010 INRA - Cepia Software Platform.
|
55 | 55 |
|
|
69 | 69 | % parse options and group into data structure
|
70 | 70 | options = parseOptions(varargin{:});
|
71 | 71 |
|
| 72 | +% additional processing of input options |
| 73 | +if any(options.delim == options.whiteSpaces) |
| 74 | + % if separator is space or tab, allow multiple separators to be treated |
| 75 | + % as only one |
| 76 | + delimOptions = {... |
| 77 | + 'Delimiter', options.delim, ... |
| 78 | + 'MultipleDelimsAsOne', true}; |
| 79 | +else |
| 80 | + % otherwise, two separators correspond to distinct columns |
| 81 | + delimOptions = {... |
| 82 | + 'Delimiter', options.delim, ... |
| 83 | + 'MultipleDelimsAsOne', false}; |
| 84 | +end |
| 85 | + |
72 | 86 |
|
73 |
| -%% Open file |
| 87 | +%% Open file for reading |
74 | 88 |
|
75 | 89 | [filePath, baseName, ext] = fileparts(fileName);
|
76 | 90 |
|
|
101 | 115 | % keep filename into data structure
|
102 | 116 | [path, name] = fileparts(fileName); %#ok<ASGLU>
|
103 | 117 |
|
104 |
| -if any(options.delim == options.whiteSpaces) |
105 |
| - % if separator is space or tab, allow multiple separators to be treated |
106 |
| - % as only one |
107 |
| - delimOptions = {... |
108 |
| - 'Delimiter', options.delim, ... |
109 |
| - 'MultipleDelimsAsOne', true}; |
110 |
| -else |
111 |
| - % otherwise, two separators correspond to distinct columns |
112 |
| - delimOptions = {... |
113 |
| - 'Delimiter', options.delim, ... |
114 |
| - 'MultipleDelimsAsOne', false}; |
115 |
| -end |
116 |
| - |
117 | 118 |
|
118 | 119 | %% Read header
|
119 | 120 |
|
|
0 commit comments