Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug output of CSV column separator characters #721

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,19 @@ public CSVFileReader(File file, Config config, boolean custDelimiter) {
if (custDelimiter) {
if (config.getBoolean(Config.CSV_DELIMETER_COMMA)) {
separator.append(",");
LOGGER.debug("comma is a CSV delimiter character");
LOGGER.debug(Messages.getString("CSVFileDAO.debugMessageCommaSeparator"));
}
if (config.getBoolean(Config.CSV_DELIMETER_TAB)) {
separator.append("\t");
LOGGER.debug("tab is a CSV delimiter character");
LOGGER.debug(Messages.getString("CSVFileDAO.debugMessageTabSeparator"));
}
if (config.getBoolean(Config.CSV_DELIMETER_OTHER)) {
separator.append(config.getString(Config.CSV_DELIMETER_OTHER_VALUE));
LOGGER.debug("CSV delimiter character: \"" + config.getString(Config.CSV_DELIMETER_OTHER_VALUE) + "\"");
LOGGER.debug(Messages.getFormattedString("CSVFileDAO.debugMessageSeparatorChar", separator));
}
} else {
separator.append(",");
LOGGER.debug(Messages.getString("CSVFileDAO.debugMessageCommaSeparator"));
}
csvDelimiters = separator.toString().toCharArray();

Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ CSVFileDAO.errorRowTooLarge=Error reading data row #{0}: the number of columns (
CSVFileDAO.errorRowTooSmall=Error reading data row #{0}: the number of columns ({1}) is less than the number of columns in the header ({2})
CSVFileDAO.debugMessageRowSize=Data row #{0}: number of columns = {1}
CSVFileDAO.debugMessageHeaderRowSize=Header row: number of columns = {0}
CSVFileDAO.debugMessageCommaSeparator=comma is a CSV delimiter character
CSVFileDAO.debugMessageTabSeparator=tab is a CSV delimiter character
CSVFileDAO.debugMessageSeparatorChar=CSV delimiter character:"{0}"

ProcessConfig.loadingConfig=Loading process configuration from config file: {0}
ProcessConfig.errorNoProcess=Error loading process: {0} configuration from config file: {1}
Expand Down