I am currently parsing this huge rpt file. In each item there is a value in parentheses. For example, "item_number_one(3.14)". How could I extract that 3.14 using the split function in python? Or is there another way to do that?
#Splits all items by comma
items = line.split(',')
#splits items within comma, just gives name
name_only = [i.split('_')[0] for i in items]
# print(name_only)
#splits items within comma, just gives full name
full_name= [i.split('(')[0] for i in items]
# print(full_Name)
#splits items within comma, just gives value in parentheses
parenth_value = [i.split('0-9')[0] for i in items]
# parenth_value = [int(s) for s in items.split() if s.isdigit()]
print(parenth_value)
parenth_value = [i.split('0-9')[0] for i in items]