If I were you, I'd write a simple script to do it with calibredb, like this, in bash like code:
Code:
for filename, attachment_id in filenames:
book_id=$(calibredb add filename | grep 'Added book ids:' | cut -d: -f2 | cut -d' ' -f2)
calibredb set_metadata book_id --field identifiers:mobileread:attachment_id
It can be easily changed to whatever programming language you like. And you can set any custom columns like this as well, use
calibredb set_metadata --list-fields
to get their names.
You can even create the custom columns using calibredb, if you dont want to involve the GUI at all.