Skip to content

Commit

Permalink
debug output of CSV column separator characters
Browse files Browse the repository at this point in the history
debug output of CSV column separator characters
  • Loading branch information
ashitsalesforce committed Jul 10, 2023
1 parent b65e3a7 commit dd2e858
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit dd2e858

Please sign in to comment.