Revision 45775 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.csv/src/main/java/org/gvsig/fmap/dal/store/csv/CSVUtils.java
CSVUtils.java | ||
---|---|---|
35 | 35 |
import java.util.Map; |
36 | 36 |
import org.apache.commons.io.FilenameUtils; |
37 | 37 |
import org.apache.commons.io.IOUtils; |
38 |
import org.apache.commons.lang3.ArrayUtils; |
|
38 | 39 |
import org.apache.commons.lang3.StringUtils; |
39 | 40 |
import org.gvsig.fmap.dal.DataTypes; |
40 | 41 |
import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor; |
... | ... | |
125 | 126 |
if( detectTypes ) { |
126 | 127 |
detectedTypes = automaticDetectionOfTypes(parameters, headers); |
127 | 128 |
} |
129 |
if( StringUtils.isBlank(headers[headers.length-1]) && |
|
130 |
(detectedTypes==null || detectedTypes[headers.length-1].isBlank()) ) { |
|
131 |
headers = ArrayUtils.remove(headers, headers.length-1); |
|
132 |
} |
|
128 | 133 |
if (detectedTypes != null && detectedTypes.length > headers.length) { |
129 | 134 |
// Se han detectado mas columnas que las que hay en la cabezera, |
130 | 135 |
// a?adimos mas columnas a la cabezera. |
... | ... | |
139 | 144 |
headers = headers2; |
140 | 145 |
} |
141 | 146 |
for (int i = 0; i < headers.length; i++) { |
142 |
if (StringUtils.isEmpty(headers[i])) {
|
|
147 |
if (StringUtils.isBlank(headers[i])) {
|
|
143 | 148 |
headers[i] = getFixedHeader(i); |
144 | 149 |
} |
145 | 150 |
} |
Also available in: Unified diff