The Civil War Soldiers and Sailors database is at the below. Will giv you rank in and out. Regiment and Company.
http://www.itd.nps.gov/cwss/