From 76a8137b2c32fe50ba75f6e2f2e1a8cf09fe1c92 Mon Sep 17 00:00:00 2001 From: Eli Flanagan Date: Mon, 3 May 2021 14:52:13 -0400 Subject: [PATCH] add a one liner to parse aws s3 ls output This demonstrates a simple transformation to trim excess spaces so you can easily split by space into a nice nu table. A more robust approach would be to look for JSON output from s3 subcommands and simply ingest that. But space delimited output rules the world of unixy `ls`. --- cool_oneliners/parse_aws_s3_ls.nu | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 cool_oneliners/parse_aws_s3_ls.nu diff --git a/cool_oneliners/parse_aws_s3_ls.nu b/cool_oneliners/parse_aws_s3_ls.nu new file mode 100644 index 0000000..a1b4771 --- /dev/null +++ b/cool_oneliners/parse_aws_s3_ls.nu @@ -0,0 +1,3 @@ +# transform the aligned text output of aws s3 ls into something useful +# presumes you have the aws CLI +aws s3 ls s3://your-bucket-and-path | lines | each { echo $it | str find-replace ' ' ' ' | str find-replace ' ' ' ' } | split column ' '