Skip to content

Commit

Permalink
Make renameDuplicateColumnHeaders case insensitive (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
s1ny1998 authored Apr 19, 2023
1 parent a25263c commit a6d644d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/tech/tablesaw/io/FileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ private void renameDuplicateColumnHeaders(String[] headerNames) {
Map<String, Integer> nameCounter = new HashMap<>();
for (int i = 0; i < headerNames.length; i++) {
String name = headerNames[i];
Integer count = nameCounter.get(name);
Integer count = nameCounter.get(name.toLowerCase());
if (count == null) {
nameCounter.put(name, 1);
nameCounter.put(name.toLowerCase(), 1);
} else {
count++;
nameCounter.put(name, count);
nameCounter.put(name.toLowerCase(), count);
headerNames[i] = name + "-" + count;
}
}
Expand Down

0 comments on commit a6d644d

Please sign in to comment.