Skip to content

Instantly share code, notes, and snippets.

@arronmabrey
Created February 29, 2016 04:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save arronmabrey/95f1b59c8d0d60d68cb9 to your computer and use it in GitHub Desktop.
Save arronmabrey/95f1b59c8d0d60d68cb9 to your computer and use it in GitHub Desktop.
amazon order/item csv merge
mlr --icsv --ocsv cut -o -f "Order ID","Title","Item Total" then put '$Title=gsub($Title, "\"", "")' items.csv > tmp-items.csv && mlr --icsv --ocsv cut -o -f "Order Date","Order ID","Total Charged","Payment Instrument Type" then nest --implode --values --across-records -f "Total Charged" orders.csv > tmp-orders.csv && mlr --icsv --ocsv join -u -j "Order ID" --lp order_ --rp item_ -f tmp-orders.csv tmp-items.csv > merged.csv && rm tmp-orders.csv tmp-items.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment