mid(line, 8, 100) is extracting the name. It starts at character 8 since “#recipe” has a length of 7 and I added 1 more to skip the space after it too. 100 is just arbitrary. I just needed something well over the length of the line. It basically just gets the rest of the line.
int() also converts text to a number. It just gets any digits and then stops when it hits anything else.
I used it as a shortcut to just grab the number at the beginning of the line.
I turn it back into text and get it’s length so I can know what character to start at for mid.
I guess I wasn’t consistent to use trim. I could very well have added 1 to account for the space
mid(line, len(str(count))+1, 100)
The trim is nice to use though. Gets rid of any unintentional trailing spaces.