Skip to content
Open
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ This software is governed by the Apache 2.0 license.

typically, to use you'd run:

node dynamoDBtoCSV.js -t Hourly_ZEDO_Impressions_by_IP > output.csv
node dynamoDBtoCSV.js -v "{}" -t Hourly_ZEDO_Impressions_by_IP > output.csv

or even:

node dynamoDBtoCSV.js -t Hourly_ZEDO_Impressions_by_IP -f output.csv
node dynamoDBtoCSV.js -v "{}" -t Hourly_ZEDO_Impressions_by_IP -f output.csv

to export to CSV

Expand Down
8 changes: 7 additions & 1 deletion dynamoDBtoCSV.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,14 @@ const unparseData = (lastEvaluatedKey) => {
});
if (writeCount > 0) {
// remove column names after first write chunk.
endData = endData.replace(/(.*\r\n)/, "");;
endData = endData.replace(/(.*\r\n)/, "");
}

// ensure each chunk ends with a newline so next chunk doesn't glue to it
if (!endData.endsWith("\n")) {
endData += "\n";
}

if (program.file) {
writeData(endData);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"aws-sdk": ">=2.0.0-rc13",
"commander": ">=2.2.0",
"commander": "6.*",
"dynamodb-marshaler": "^2.0.0",
"papaparse": "^5.3.0"
}
Expand Down