Skip to content

Commit 303e85c

Browse files
author
Robin Duda
committed
parse headers when encountering the first CR or LF.
1 parent d1d6bec commit 303e85c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/codingchili/Model/CSVParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private void readHeaders() {
122122

123123
for (long i = 0; i < fileSize; i++) {
124124
byte current = get();
125-
if (current == '\r') {
125+
if (current == TOKEN_LF || current == TOKEN_CR) {
126126
Arrays.stream(new String(buffer.array()).split(","))
127127
.map(header -> header.replaceAll("\"", ""))
128128
.map(String::trim).forEach(header -> {

0 commit comments

Comments
 (0)