csv-txt-excel-parallel-toolkit 0.4.7

A parallel and fast command line toolkit for small and large (>10G) CSV, TXT, and EXCEL files, with a unified api.
use crate::utils::{cli_result::CliResult, table::Table};
use std::{
    fs::File,
    io::{BufRead, BufReader},
    path::Path,
};

pub fn run(path: &Path, sep: &str) -> CliResult {
    // rdr
    let rdr = BufReader::new(File::open(path)?);

    let rows = rdr
        .lines()
        .into_iter()
        .filter_map(|r| r.ok())
        .map(|r| r.split(sep).map(|i| i.to_owned()).collect::<Vec<_>>())
        .collect::<Vec<_>>();

    Table::from_records(rows).print_blank()?;

    Ok(())
}