Slide 9 of 29
Notes:
Here we read each line from the costs text file,
skip lines that don't start with digits,
extract the product and cost,
apply the margin (or a default),
apply the note (or a default),
Again: very few lines of code and just about every line directly related to the task.