How to sell digital goods (redeem codes) using Drupal?
There's a UC solution called UC Product Keys out there for this particular use case, but you're better off avoiding it; the project has no 7.x version and is minimally maintained. 

The Drupal Commerce equivalent is Commerce Product Key...


  This module lets sites implementing the Commerce module, attach
  product keys to orders. Product keys / Vouchers are strings of text
  that are used to unlock or activate a piece of software.
  
  Right now we have an entity that can be attached to a product and then
  assigned via a rule to a product once it has been bought. The required
  actions and rules events are fleshed out and simply require the wiring
  up of the rules to meet you scenario.


It probably won't do everything you need (e.g. import license keys), but it should be a good starting point to build your own product key solution off of.