That's not hard to do. You can buy "Battery Eliminator Circuits", or BECs, from any of the R/C hobbyist suppliers. They take in a noisy
7 to 20VDC and output a clean 5VDC.Here are some commercial units:
formatting link
Linear regulator with big heat sink for $9, switching regulator for $47. Choose based on how important battery life is in your application.
How much current do you need?
John Nagle