Inspired by topic modeling and clustering analysis of Taylor Swift's lyrics, I want to do the same for the band Nightwish. I scraped Dark Lyrics (see script) for all of their lyrics and saved the results into a single plain text file that looks like this:
To perform my intended analyses, I want the target file to look like this, where each row is a line of lyric with columns indicating the corresponding album (wrapped around by "*") and song (after a track number "n. ") titles.
Maybe I can just read each line as a row and manually add album and song titles. However, I was wondering if there's a more efficient way to do this.