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

add an option to define a null replacement value #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions src/main/java/com/after_sunrise/sx8000/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ public static void main(String[] args) throws Exception {
@Parameter(names = {"-e", "--encoding"}, description = "Output file encoding. (cf: \"ISO-8859-1\", \"UTF-16\")")
private String encoding = StandardCharsets.UTF_8.name();

@Parameter(names = {"-d", "--delimiter"}, description = "CSV column delimiter character.")
@Parameter(names = {"-n", "--nullReplacement"}, description = "A replacement value for NULL one.")
private String nullReplacement = null;

@Parameter(names = {"-d", "--delimiter"}, description = "CSV column delimiter character.")
private char csvSeparator = CSVWriter.DEFAULT_SEPARATOR;

@Parameter(names = {"-q", "--quote"}, description = "CSV column quote character.")
Expand Down Expand Up @@ -164,7 +167,7 @@ void execute() throws Exception {

Object object = rs.getObject(i + 1);

values[i] = Objects.toString(object, null);
values[i] = Objects.toString(object, nullReplacement);

}

Expand Down