Python
import csv
source = open( "myfile.csv", "rb" )
rdr= csv.reader( source )
for row in rdr:
print "The sample battery has a Voltage: %.1fV, and capacity: %dmAh" % ( float(row[0]), int(row[1]), )
Will get you started with pulling data from a CSV file.
Apparently (based on comments) the file looks like this.
"The sample battery has a Voltage: 11.1V, and capacity: 4500mAh"
Which could be a 1-column CSV. Or a single row with bonus quotes. Let's pretend it's a 1-column CSV.
import csv
import re
v_pat= re.compile(r' (\d+\.\d+)V' )
mah_pat = re.compile(r' (\d+)mAh' )
source = open( "myfile.csv", "rb" )
rdr= csv.reader( source )
for row in rdr:
v_match= v_pat.search( row[0] )
mah_match= mah_pat.search( row[0] )
if v_match and mah_match:
print v_match.group(1), mah_match.group(1)
else:
print # empty line -- not very informative
Something like that might be appropriate.