diff --git a/src/nmreval/io/asciireader.py b/src/nmreval/io/asciireader.py index 979c560..c10c158 100644 --- a/src/nmreval/io/asciireader.py +++ b/src/nmreval/io/asciireader.py @@ -1,5 +1,6 @@ import pathlib import re +from io import BytesIO from itertools import islice import numpy as np @@ -99,7 +100,10 @@ class AsciiReader: y = list(range(1, max(self.width))) cols = x + y + yerr - raw_data = np.genfromtxt(self.fname, usecols=cols, missing_values='--') + with self.fname.open('rb') as fh: + tmp_ = re.sub(b'[;,]', b' ', fh.read()) + raw_data = np.genfromtxt(BytesIO(tmp_), usecols=cols, missing_values='--') + del tmp_ if raw_data.ndim == 1: # only one row or column if len(self.data) == 1: