Skip to content

Instantly share code, notes, and snippets.

@claytantor
Created November 9, 2015 04:54
Show Gist options
  • Save claytantor/b10cb69492204dd0c2e1 to your computer and use it in GitHub Desktop.
Save claytantor/b10cb69492204dd0c2e1 to your computer and use it in GitHub Desktop.
How to list aws dir as CSV
#!/bin/bash
aws s3 ls s3://dronze.2b67/data/wiki --region=us-west-2 --recursive | python -c '
import sys
for line in sys.stdin:
r = line.strip("\n").split(None, 10)
fn = r.pop()
print ",".join(r) + "," + fn.replace("\"", "\"\"")
'>wiki_docs.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment