# HG changeset patch # User Tom Gottfried # Date 1368700463 -7200 # Node ID f9c5e1a8032d551e0f9b5a4c787e0307930c9987 # Parent 25d927cb4b259154123863d51226fc124229f88f WstParser: set column names from specified line also if unspecified line does not exist diff -r 25d927cb4b25 -r f9c5e1a8032d backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java Thu May 16 12:31:53 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/WstParser.java Thu May 16 12:34:23 2013 +0200 @@ -248,9 +248,15 @@ int unknownCount = 0; HashSet uniqueColumnNames = new HashSet(); + if (langBezeichner != null) { + // use column name from '*!column-bez-text'-line + lsBezeichner = StringUtil.fitArray( + langBezeichner, lsBezeichner); + } for (int i = 0; i < lsBezeichner.length; ++i) { if (lsBezeichner[i] == null || lsBezeichner[i].length() == 0) { + // generate alternative column names double q = firstAbfluesse[i].doubleValue(); if (q < 0.001) { lsBezeichner[i] = @@ -309,8 +315,7 @@ } else { // firstAbfluesse == null if (langBezeichner != null) { - lsBezeichner = StringUtil.fitArray( - langBezeichner, lsBezeichner); + // nothing to do } else if (colNaWidths != null) { for (int j = 0, i = 0, N = input.length();