def comma_separated_int(s):
    """
    Used as the 'dtype' argument to TextFileParser.add_field(), to parse integer fields
    which appear in text files with comma separators.
    """

    s = s.replace(',','')
    return int(s)