1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-15 05:45:05 -05:00

* fix csv() function not visible in Expression Format issue

This commit is contained in:
Reinhard Pointner 2014-07-05 13:11:57 +00:00
parent 1d5dae9567
commit a451de436b

View File

@ -88,11 +88,13 @@ public class ExpressionFormatFunctions {
return obj;
}
public Map<String, String> csv(String path) throws IOException {
public static Map<String, String> csv(String path) throws IOException {
Map<String, String> map = new LinkedHashMap<String, String>();
for (String line : Files.readAllLines(Paths.get(path), Charset.forName("UTF-8"))) {
String[] field = line.split(";", 2);
map.put(field[0], field[1]);
if (field.length >= 2) {
map.put(field[0], field[1]);
}
}
return map;
}