I need to parse an output text file that has a lot of information, specifically about weighing and calibrating masses. There is a data table in this text file that has the name of the mass being tested, its nominal weight, density, and other properties of the mass.
Here's a picture of what this part of the text file looks like. I want to have five capture groups, for each column. Right now, I have
tablePattern = r'\[mg\]\s*(.{4,15})\s+(\d*)\s*(\d*)\s*(\d*)\s*(\d*)'
tableMatches = re.findall(tablePattern, text)
However, this gives me matches I don't want, and it doesn't return all the capture groups I want. Any help would be appreciated!