mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-15 13:55:03 -05:00
* fix csv() function not visible in Expression Format issue
This commit is contained in:
parent
1d5dae9567
commit
a451de436b
@ -88,12 +88,14 @@ public class ExpressionFormatFunctions {
|
|||||||
return obj;
|
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>();
|
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||||
for (String line : Files.readAllLines(Paths.get(path), Charset.forName("UTF-8"))) {
|
for (String line : Files.readAllLines(Paths.get(path), Charset.forName("UTF-8"))) {
|
||||||
String[] field = line.split(";", 2);
|
String[] field = line.split(";", 2);
|
||||||
|
if (field.length >= 2) {
|
||||||
map.put(field[0], field[1]);
|
map.put(field[0], field[1]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user