Skip to content

Instantly share code, notes, and snippets.

@boyswan
Last active September 10, 2018 13:54
Show Gist options
  • Save boyswan/7b62484f5cee657fe79fb2003fbd46ce to your computer and use it in GitHub Desktop.
Save boyswan/7b62484f5cee657fe79fb2003fbd46ce to your computer and use it in GitHub Desktop.
#!/bin/bash
IFS=$';'
for i in {3,5,9,17,33,65,129}
do
query=$(sqlite3 "/Users/jackboyce/Library/Application Support/Ableton/Live Database/Live-files-32.db" "SELECT _rowid_,* FROM main.files WHERE colors = $i")
copyFile () {
while read data; do
mkdir -p $i
find /Users/jackboyce/Samples -name $data -type f -exec cp {} ./$i \;
done
}
echo $query | xargs -L 1 bash -c 'echo "$0 $1 $2 $3 $4 $5" | cut -d "|" -f9' | copyFile
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment