Bar code scanners used with computers usually just output some numbers and an enter. Like a keyboard.
Start with a program that can read things from the keyboard, and then save them to a database.
Create another program that exports the database content to either csv or an excel file for instance with Apache POI.