diff --git a/Kitodo/src/main/java/org/kitodo/production/services/data/MassImportService.java b/Kitodo/src/main/java/org/kitodo/production/services/data/MassImportService.java index 1687d5c6def..814deee1b8d 100644 --- a/Kitodo/src/main/java/org/kitodo/production/services/data/MassImportService.java +++ b/Kitodo/src/main/java/org/kitodo/production/services/data/MassImportService.java @@ -90,13 +90,13 @@ public List getLines(UploadedFile file) throws IOException { */ public List parseLines(List lines, String separator) throws IOException, CsvValidationException { List records = new LinkedList<>(); + CSVParser parser = new CSVParserBuilder() + .withSeparator(separator.charAt(0)) + .withQuoteChar('\"') + .build(); for (String line : lines) { if (!Objects.isNull(line) && !line.isBlank()) { List cells = new LinkedList<>(); - CSVParser parser = new CSVParserBuilder() - .withSeparator(separator.charAt(0)) - .withQuoteChar('\"') - .build(); CSVReader csvReader = new CSVReaderBuilder(new StringReader(line)) .withSkipLines(0) .withCSVParser(parser)