Hi There.
I'm trying to write a code that reads the filenames of objects of the form "gal_z7.25. sae" and "gal_z0.02563.s ae" and stores the decimal digit parts ONLY to a list.
So far I have the following:
printing filelist gives me the following:
/home/clemence/Desktop/testing/gal_z0.275.sae'
And each item in filelist contains the numbers I need. All I need is a way of ignoring the text and taking only the numbers into another list.
Please help
I'm trying to write a code that reads the filenames of objects of the form "gal_z7.25. sae" and "gal_z0.02563.s ae" and stores the decimal digit parts ONLY to a list.
So far I have the following:
Code:
import glob
import sys, os
#Open folder with files
filelist = glob.glob("/home/clemence/Desktop/testing/*.sae")
/home/clemence/Desktop/testing/gal_z0.275.sae'
And each item in filelist contains the numbers I need. All I need is a way of ignoring the text and taking only the numbers into another list.
Please help
Comment