I'm working on a song book using LaTeX. It's early in the project, and the songs aren't all picked out yet, but I thought I'd fix the inner workings of it in the meantime.
Since many people will (hopefully) be involved, and many songs included, I want to save all songs separately and \input them.
The dream would be to have a text file where the songs are listed like
Thrift shop-macLemore
Two worlds, one family-from Tarzan
Gagnam Style-Psy
and for me to be able to loop through the list and say (Sorry for mixing languages):
for(line l : index.txt) {
String[] k = l.split('-');
\includesong{k[0]}{k[1]}
}
Is there any good way to do this?
EDIT: I found a package called parselines that does the job fairly well. Especially combined with a little regex-fu (Why is there so little information on the internet about \def\foo#1, #2?).
docsvlist
andforcsvlist
commands from theetoolbox
package (see also this answer)