Tuesday, June 17, 2025

mixxx export playlist as csv run csvkit on it to find duration of set


csvtool col 4 vertagogo.csv | tail -n +2 | awk -F: '{
    min=$1;
    sec=$2;
    total += min * 60 + sec;
} END {
    h = int(total / 3600);
    m = int((total % 3600) / 60);
    s = total % 60;

    if (h > 0) {
        printf "Total Duration: %d hour%s %d minute%s %d second%s\n",
            h, (h!=1?"s":""),
            m, (m!=1?"s":""),
            s, (s!=1?"s":"");
    } else if (m > 0) {
        printf "Total Duration: %d minute%s %d second%s\n",
            m, (m!=1?"s":""),
            s, (s!=1?"s":"");
    } else {
        printf "Total Duration: %d second%s\n", s, (s!=1?"s":"");
    }
}'

Assuming duration is in the 4th col then this script works
I also jumped through some hoops trying to figure out a way to sort them in the CLI by bpm but you can just click on them in mix.

No comments:

Post a Comment