diff --git a/source/net/yacy/cora/geo/GeonamesLocation.java b/source/net/yacy/cora/geo/GeonamesLocation.java index cfc1da8eb..053fb9bba 100644 --- a/source/net/yacy/cora/geo/GeonamesLocation.java +++ b/source/net/yacy/cora/geo/GeonamesLocation.java @@ -129,7 +129,7 @@ public class GeonamesLocation implements Locations { if ( line.isEmpty() ) { continue; } - fields = line.split("\t"); + fields = CommonPattern.TAB.split(line); final long population = Long.parseLong(fields[14]); if (minPopulation > 0 && population < minPopulation) continue; final int geonameid = Integer.parseInt(fields[0]); diff --git a/source/net/yacy/cora/util/CommonPattern.java b/source/net/yacy/cora/util/CommonPattern.java index 93f7a1f99..a31d0132a 100644 --- a/source/net/yacy/cora/util/CommonPattern.java +++ b/source/net/yacy/cora/util/CommonPattern.java @@ -52,5 +52,6 @@ public class CommonPattern { public final static Pattern NEWLINE = Pattern.compile("\n"); public final static Pattern VERTICALBAR = Pattern.compile(Pattern.quote("|")); public final static Pattern UNDERSCORE = Pattern.compile("_"); + public final static Pattern TAB = Pattern.compile("\t"); } diff --git a/source/net/yacy/document/parser/csvParser.java b/source/net/yacy/document/parser/csvParser.java index c5b46627a..f6476e37b 100644 --- a/source/net/yacy/document/parser/csvParser.java +++ b/source/net/yacy/document/parser/csvParser.java @@ -112,7 +112,7 @@ public class csvParser extends AbstractParser implements Parser { // try comma, semicolon and tab; take that one that results with more columns final String[] colc = CommonPattern.COMMA.split(row); final String[] cols = CommonPattern.SEMICOLON.split(row); - final String[] colt = row.split("\t"); + final String[] colt = CommonPattern.TAB.split(row); if (colc.length >= cols.length && colc.length >= colt.length) separator = ","; if (cols.length >= colc.length && cols.length >= colt.length) separator = ";"; if (colt.length >= cols.length && colt.length >= colc.length) separator = "\t";