Skip to content

Commit

Permalink
unwrap text nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbranham committed Apr 27, 2020
1 parent 2264057 commit 28f6d9a
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -78,8 +78,13 @@ private static void writeDataRow(JsonNode data, String[] sortedHeaders, CSVPrint
String[] sortedRec = new String[recordLength];
for (int i = 0; i < recordLength; i++) {
String key = sortedHeaders[i];
if (data.has(key))
sortedRec[i] = data.get(key).toString();
if (data.has(key)) {
if (data.get(key).isTextual()) {
sortedRec[i] = data.get(key).asText();
} else {
sortedRec[i] = data.get(key).toString();
}
}
}
csvPrinter.printRecord(sortedRec);
} catch (Exception ex) {
Expand Down

0 comments on commit 28f6d9a

Please sign in to comment.