-
Notifications
You must be signed in to change notification settings - Fork 0
/
makelist
executable file
·32 lines (19 loc) · 896 Bytes
/
makelist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
#initial list for the DB
#giant pile of shell glop to get a file list for easy import - should turn in to 3 columns in tsv
(cd ~/Downloads/kar/all; find [A-Z] 999) | grep -i cdg | sort > /tmp/aaa
#directory
awk -F / '{print $1}' < /tmp/aaa > /tmp/aaa1
#track
awk -F / '{print $2}' < /tmp/aaa > /tmp/aaa2
#artist
sed 's/- .*//' < /tmp/aaa2 > /tmp/aaa3
#songname
grep -o ' - .*' /tmp/aaa2 | cut -c4- | sed 's/\.cdg//' > /tmp/aaa4
#paste together
echo "Dir\tPathname\tArtist\tTitle" > /usr/local/fred/kar/karaoke-finder/filelist.tsv
paste /tmp/aaa1 /tmp/aaa2 /tmp/aaa3 /tmp/aaa4 >> /usr/local/fred/kar/karaoke-finder/filelist.tsv
cp /usr/local/fred/kar/karaoke-finder/filelist.tsv ~/Downloads/
#rm /tmp/aaa1 /tmp/aaa2 /tmp/aaa3
#todo gotta do something special for the frozen and disney directories
# or maybe just rename/cleanse/normalize the actual files... both tedious