I'm having trouble using python reg exp to read data from a file.
The file has data I want and some info I'm not interested in. An example of the info I'm interested in is below. The number of rows will vary
FREQ VM(VOUT)
1.000E+00 4.760E+01
1.002E+00 4.749E+01
Y
I want to create a list of tuples like:
[(1.000, 47.6),(1.002, 47.49)]
I'm trying to read the file till I find the 'FREQ VM(VOUT)' line and read the data points till I hit the 'Y'.
I have 2 questions:
- Is it possible to get all the points with one expression or do I need to loop through each line and look for the start end? I can't seem to get the the reg exp to work when I try to find the section and read the points in a single expression.
- How do I parse a number that is in engineering notation?
I couldn't find an example that was very close to what I'm doing. If it is out there, please point me to it.