Sep-05-2017, 02:00 PM
Puh, when the whole thing is so undefined, thats not easy to solve correctly.
I have the absolute brute-force method for it:
You should call it brute_fore_reader.py
I have the absolute brute-force method for it:
import string def filter_text(text, allowed=string.digits + '.,'): return ''.join(filter(lambda c: c in allowed, text)) def process_line(line): return list(map(float, filter_text(line).split(','))) if __name__ == '__main__': with open('test.csv', errors='replace') as fd: for line in fd: print(process_line(line))Test this against your data. With this code it is even possible to parse data, when normal chars are between the numbers.
You should call it brute_fore_reader.py
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!