diff --git a/src/io.rs b/src/io.rs index 4b86ee9..ec3abe8 100644 --- a/src/io.rs +++ b/src/io.rs @@ -143,16 +143,16 @@ fn read_window_file(window_file: &str, cfg: &Config) -> Option { // read and parse each timeseries line let mut line = String::new(); while buf.read_line(&mut line).unwrap() > 0 { + // skip comments and empty lines + if line.starts_with("#") || line.starts_with("@") || line.len() == 0 { + line.clear(); + continue; + } + { - // skip comments and empty lines - if line.starts_with("#") || line.starts_with("@") || line.len() == 0 { - continue; - } - let mut split = line.split_whitespace(); + split.next(); // skip time/step column - - let values: Vec = (0..cfg.dimens).collect::>().iter().map(|_| { split.next().unwrap().parse::().unwrap() }).collect();