Skip to content

Commit

Permalink
Bugfix, automatic detect csv and quoted strings
Browse files Browse the repository at this point in the history
Bugfix, automatically detecting csv separator character in certain cases incorrect due to quoted strings with CrLf
  • Loading branch information
BdR76 committed Mar 3, 2023
1 parent 188bc67 commit 1e6cdb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CSVLintNppPlugin/CsvLint/CsvAnalyze.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ public static CsvDefinition InferFromData(bool autodetect, char mansep, string m
linesQuoted++;
}

// stop after 20 lines
if (lineContent++ > 20) break;
// stop after 20 lines. Exception; quoted string values can also contain newline char,
// do not stop inspecting halfway through a quoted string because that would mis-count frequency of separator characters
if ( (++lineContent > 20 - 1) && (!inQuotes) ) break;
}
}

Expand Down

0 comments on commit 1e6cdb5

Please sign in to comment.