You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Combine all files into one and split into 25 batches (AWS CLI limit)
cat temp/*.json > temp/combined
rm temp/*.json
split -l 25 temp/combined temp/
rm temp/combined
# DynamoDB exports items one per line, so we need to wrap each line in a PutRequest object and then wrap all of them in a request object
for file in temp/*; do
echo "Transforming $file"
cat $file | sed -e 's/^/{"PutRequest":/' | sed -e 's/$/},/' | sed -e '$s/,$//' | sed -e '1s/^/{"'$TARGET_TABLET'":[/' | sed -e '$s/$/]}/' > "$file".json