pub fn skip_first_line_of_file(path:&Path) -> anyhow::Result<File> {
    let file = File::open(path)?;
    // want to jump to the first newline. Simplest efficient way to do this is make a buffered reader to get the position...
    let mut buffered = BufReader::new(file);
    buffered.read_line(&mut String::new())?;
    let position = buffered.stream_position()?;
    let mut file = buffered.into_inner(); // get back the file.
    file.seek(SeekFrom::Start(position))?;
    Ok(file)
}
/// Read a file, skipping the first line. This is useful for parsing CSV files where the
/// first line is some status message, which the csv crate does not deal with.
Read a file, skipping the first line. This is useful for parsing CSV files where the
first line is some status message, which the csv crate does not deal with.
Read a file skipping the first line . This is useful for parsing CSV files where the first line is some status message which the csv crate does not deal with .
pub fn skip_first_line_of_file(path:&Path) -> anyhow::Result<File> {
    let file = File::open(path)?;
    // want to jump to the first newline. Simplest efficient way to do this is make a buffered reader to get the position...
    let mut buffered = BufReader::new(file);
    buffered.read_line(&mut String::new())?;
    let position = buffered.stream_position()?;
    let mut file = buffered.into_inner(); // get back the file.
    file.seek(SeekFrom::Start(position))?;
    Ok(file)
}
pub fn skip_first_line_of_file ( path : & Path ) -> anyhow :: Result < File > { let file = File :: open ( path ) ? ; // want to jump to the first newline. Simplest efficient way to do this is make a buffered reader to get the position... let mut buffered = BufReader :: new ( file ) ; buffered . read_line ( & mut String :: new ( ) ) ? ; let position = buffered . stream_position ( ) ? ; let mut file = buffered . into_inner ( ) ; // get back the file. file . seek ( SeekFrom :: Start ( position ) ) ? ; Ok ( file ) }
Read a file, skipping the first line.
Read a file skipping the first line .
path
&Path
path
&Path