Have you considered to work with the internal BOM (configured with .frm file) function of Creo?
Because you can export this BOM to a text file as well or even as a .csv file.
The advantage of this way is, that by setting your .frm file you can put the most functionality internally by Creo (like adding up duplicates, levels, filtering...).
See the picture of an example .frm table. Note that you have to define an repeat region for that.