'Reads separated lines from file and print back only the lines that pass a filter.'

def filter_file_fields(self, loc_file, values):

    with open(loc_file) as reader:
        rval = ''
        for line in reader:
            if line.lstrip().startswith(self.comment_char):
                rval += line
            else:
                line_s = line.rstrip('\n\r')
                if line_s:
                    fields = line_s.split(self.separator)
                    if (fields != values):
                        rval += line
    with open(loc_file, 'wb') as writer:
        writer.write(rval)
    return rval
