mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-15 05:45:05 -05:00
Refactor
This commit is contained in:
parent
a34882b4bf
commit
4e7f45f244
@ -54,10 +54,11 @@ public class ExpressionFormatFunctions {
|
||||
}
|
||||
|
||||
public static Map<String, String> csv(String path) throws IOException {
|
||||
Pattern[] delimiter = { TAB, SEMICOLON };
|
||||
Map<String, String> map = new LinkedHashMap<String, String>();
|
||||
streamLines(new File(path)).forEach(line -> {
|
||||
for (Pattern delim : new Pattern[] { TAB, SEMICOLON }) {
|
||||
String[] field = delim.split(line, 2);
|
||||
for (Pattern d : delimiter) {
|
||||
String[] field = d.split(line, 2);
|
||||
if (field.length >= 2) {
|
||||
map.put(field[0].trim(), field[1].trim());
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user