-
Notifications
You must be signed in to change notification settings - Fork 653
Closed
Description
I have problen when I try to output the table in fixed width format in these two ways:
double[] v1 = {1, 2, NaN};
double[] v2 = {1, 2, NaN};
Table table = Table.create("table", DoubleColumn.create("v1", v1), DoubleColumn.create("v2", v2));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
FixedWidthWriteOptions options =
new FixedWidthWriteOptions.Builder(baos).build();
FixedWidthWriter writer = new FixedWidthWriter();
writer.write(table, options);
and
double[] v1 = {1, 2, NaN};
double[] v2 = {1, 2, NaN};
Table table = Table.create("table", DoubleColumn.create("v1", v1), DoubleColumn.create("v2", v2));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
FixedWidthFields fwf = new FixedWidthFields(10, 10);
FixedWidthWriteOptions options =
new FixedWidthWriteOptions.Builder(baos)
.autoConfigurationEnabled(false)
.header(fwf) // this function set the value to FixedWidthWriteOptions.columnSpecs
.build();
FixedWidthWriter writer = new FixedWidthWriter();
writer.write(table, options);
I found that FixedWidthWriterSettings.fieldLengths
is always null, and FixedWidthFields.columnSpecs
inputted by user is not assigned to FixedWidthWriterSettings.fieldLengths
. I plan to assign the value to FixedWidthWriterSettings.fieldLengths
in FixedWidthWriter.fixedWidthWriterSettings()
.
If the solution is acceptable, I would like to pull a request to fix it.
ChangzhenZhang
Metadata
Metadata
Assignees
Labels
No labels