Are those books already added to Calibre library? And does each book have amazon id (or even "mobi-assin") in ID section of metadata?
If the answers are yes then you can use Calibre plugin
"Quality Check" for 1-click bulk ASIN insertion & PDOC>EBOK edit. (by selecting all the books and doing : Fix> Fix ASIN for Kindle Fire).