From a6109c65b905eead2da898eea7a7b34293402988 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Tue, 5 Jul 2016 11:58:37 +0200 Subject: [PATCH] printed too often what is read --- src/fileio/bds_file_reader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fileio/bds_file_reader.py b/src/fileio/bds_file_reader.py index 4e2d8a9..e755133 100644 --- a/src/fileio/bds_file_reader.py +++ b/src/fileio/bds_file_reader.py @@ -8,13 +8,13 @@ class FileReader: def read_datafile( path ): # TODO analyze file (LF,MF, HF) and act accordingly print "Skipping first 4 lines!" - data = np.loadtxt(path, skiprows=4) + data = np.loadtxt(path, skiprows=4, comments="#") numpat = re.compile('\d+\.\d+') print "successfully read %s"%path try: Temp = None + print "Searching for temperature in %s (any line with 'Fixed or 'Temp', with float, i.e. 273.15K or 273.15)" % path for i,line in enumerate(open(path).readlines()): - print "Searching for temperature in %s (Line with 'Fixed or 'Temp', with float, i.e. 273.15K or 273.15)"%path if re.search("Fixed", line) or re.search("Temp", line): print "Found line containing 'Fixed' or 'Temp' (line %i):"%i print line