Categories
notes

Converting Rekordbox History to Usable Text

One handy feature of the Pioneer DJ/Rekordbox ecosystem is the built in saved history of everything you play. This is really nice when you want to post a list of tracks you played in a set online. You can very easily export the history as a playlist in text format, but if you try to copy and paste that it comes out all garbled with a lot of extra characters. The problem comes down to the encoding of the text file.

The playlist export files are actually in utf-16le. Here’s a command that can be run in the macOS terminal (and most unix I imagine) to show you…

file -I BRC_2023_Fauxliage_Tues.txt
BRC_2023_Fauxliage_Tues.txt: text/plain; charset=utf-16le

And to use the content how we want, we need to convert it to another format. It can be converted to the very common utf-8 like using either iconv (included in macOS) or the simpler dos2unix command (install from homebrew).

iconv -f utf-16le -t utf-8 BRC_2023_Fauxliage_Tues.txt > BRC2023-utf8.txt; mv BRC2023-utf8.txt BRC_2023_Fauxliage_Tues.txt
dos2unix BRC_2023_Fauxliage_Tues.txt

That will get our file into the right format but we probably want to format it to show less information.

This clever command will output only the 2nd and 3rd columns (title and artist respectively) with a bit of text formatting …

awk -F'\t' '{ printf "\"%s\" by %s\n"  ,$2, $3 }' BRC_2023_Fauxliage_Tues.txt

The output is something like this…

"Track Title" by Artist
"Losing Ground (Extended Mix)" by Sultan + Shepard, Tishmal
"Enough to Believe (Jamie Jones Remix)" by Bob Moses
"Hate Street Dialogue (Original Mix)" by Rodriguez, The Avener
"Do It (Original Mix)" by D.Y.A
"Days Of Innocence (Dream Mix)" by Rhode & Brown, Benjamin Fröhlich

This saves a ton of time!