<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_limits_table_file(f):
 """Parse a space-separated file containing reaction flux limits The first column contains reaction IDs while the second column contains the lower flux limits. The third column is optional and contains the upper flux limit. """


    for line in f:
        line, _, comment = line.partition('#')
        line = line.strip()
        if line == '':
            continue

        # A line can specify lower limit only (useful for
        # exchange reactions), or both lower and upper limit.
        fields = line.split(None)
        if len(fields) < 1 or len(fields) > 3:
            raise ParseError('Malformed reaction limit: {}'.format(fields))

        # Extend to three values and unpack
        fields.extend(['-']*(3-len(fields)))
        reaction_id, lower, upper = fields

        lower = float(lower) if lower != '-' else None
        upper = float(upper) if upper != '-' else None

        yield reaction_id, lower, upper