From 5f70f204a7d399daa7e2d45ac3d7a3577e0167d3 Mon Sep 17 00:00:00 2001 From: Pascal Borreli Date: Fri, 29 Jan 2021 15:36:13 +0100 Subject: [PATCH 1/3] Freeze commander dep --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 85d3e7d..ecb9ea2 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "aws-sdk": ">=2.0.0-rc13", - "commander": ">=2.2.0", + "commander": "2.*", "dynamodb-marshaler": "^2.0.0", "papaparse": "^5.3.0" } From e57e93391497f44e5c501556020d19e998e42f92 Mon Sep 17 00:00:00 2001 From: Pascal Borreli Date: Fri, 29 Jan 2021 15:36:44 +0100 Subject: [PATCH 2/3] Freeze dep --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ecb9ea2..954ca6d 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "aws-sdk": ">=2.0.0-rc13", - "commander": "2.*", + "commander": "6.*", "dynamodb-marshaler": "^2.0.0", "papaparse": "^5.3.0" } From c5d1e40c9d081ca3b902a221461b38c3638d69b2 Mon Sep 17 00:00:00 2001 From: cile1993 Date: Sat, 6 Dec 2025 08:35:31 +0100 Subject: [PATCH 3/3] [37465] Fix issue when chunking on large amount of data sometimes doesn't produce new line when combining chunks, update README.md for a proper usage internally --- README.md | 4 ++-- dynamoDBtoCSV.js | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 343fb38..8db75eb 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/dynamoDBtoCSV.js b/dynamoDBtoCSV.js index 38ef6d0..ada01a7 100644 --- a/dynamoDBtoCSV.js +++ b/dynamoDBtoCSV.js @@ -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 {