Function split

Source
pub fn split<P>(
    file_path: P,
    max_file_size_bytes: u64,
    num_header_lines: u8,
    output_dir: P,
) -> Result<(), Box<dyn Error>>
where P: AsRef<Path> + Display + Clone,
Expand description

Splits a text file into pieces with the size of each piece below a specified maximum number of bytes.

§Arguments

  • file_path - the path of the file to be split.
  • max_file_size_bytes - the maximum size of each piece of the file in bytes after splitting.
  • num_header_lines - how many lines are the file’s header. If no header lines, use 0. Header lines will be kept in each of the pieces.
  • output_dir - where to write the pieces of the file.