pub fn parse_xlsx_by_converting_to_csv_using_openoffice(path:&PathBuf) -> anyhow::Result<Vec<Vec<String>>> {
    // run open office
//    println!("Converting {:?}",path);
    let temp_path = temp_dir();
    Command::new("libreoffice").arg("--headless").arg("--convert-to").arg("csv").arg(path).arg("--outdir").arg(&temp_path).output()?;
    let filename = path.file_name().ok_or_else(||anyhow!("Provided path {:?} doesn't seem to have a file name",&path))?;
    let mut output_path = temp_path.join(filename);
    output_path.set_extension("csv");
//    println!("Created at {:?}",output_path);
    let mut res = vec![];
    {
        let reader = csv::ReaderBuilder::new().has_headers(false).from_path(&output_path)?;
        for record in reader.into_records() {
            let record=record?;
            let cols = record.iter().map(|s|s.to_string()).collect::<Vec<_>>();
            res.push(cols);
        }
    }
    std::fs::remove_file(output_path)?;
    Ok(res)
}
/// Parse an xslx file by the horrible convoluted method of running libreoffice to convert it
/// into a csv file in the temporary directory, reading that into an array of strings, and
/// then deleting the csv file. Requires openoffice to be installed!
///
/// It is generally better to use a library like calamine, but if that doesn't work for some reason,
/// this is a fall back.
Parse an xslx file by the horrible convoluted method of running libreoffice to convert it
into a csv file in the temporary directory, reading that into an array of strings, and
then deleting the csv file. Requires openoffice to be installed!

It is generally better to use a library like calamine, but if that doesn't work for some reason,
this is a fall back.
Parse an xslx file by the horrible convoluted method of running libreoffice to convert it into a csv file in the temporary directory reading that into an array of strings and then deleting the csv file . Requires openoffice to be installed! It is generally better to use a library like calamine but if that doesn ' t work for some reason this is a fall back .
pub fn parse_xlsx_by_converting_to_csv_using_openoffice(path:&PathBuf) -> anyhow::Result<Vec<Vec<String>>> {
    // run open office
//    println!("Converting {:?}",path);
    let temp_path = temp_dir();
    Command::new("libreoffice").arg("--headless").arg("--convert-to").arg("csv").arg(path).arg("--outdir").arg(&temp_path).output()?;
    let filename = path.file_name().ok_or_else(||anyhow!("Provided path {:?} doesn't seem to have a file name",&path))?;
    let mut output_path = temp_path.join(filename);
    output_path.set_extension("csv");
//    println!("Created at {:?}",output_path);
    let mut res = vec![];
    {
        let reader = csv::ReaderBuilder::new().has_headers(false).from_path(&output_path)?;
        for record in reader.into_records() {
            let record=record?;
            let cols = record.iter().map(|s|s.to_string()).collect::<Vec<_>>();
            res.push(cols);
        }
    }
    std::fs::remove_file(output_path)?;
    Ok(res)
}
pub fn parse_xlsx_by_converting_to_csv_using_openoffice ( path : & PathBuf ) -> anyhow :: Result < Vec < Vec < String > > > { // run open office //    println!("Converting {:?}",path); let temp_path = temp_dir ( ) ; Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( path ) . arg ( " " ) . arg ( & temp_path ) . output ( ) ? ; let filename = path . file_name ( ) . ok_or_else ( | | anyhow ! ( " " path ) ) ? ; let mut output_path = temp_path . join ( filename ) ; output_path . set_extension ( " " ) ; //    println!("Created at {:?}",output_path); let mut res = vec ! [ ] ; { let reader = csv :: ReaderBuilder :: new ( ) . has_headers ( false ) . from_path ( & output_path ) ? ; for record in reader . into_records ( ) { let record = record ? ; let cols = record . iter ( ) . map ( | s | s . to_string ( ) ) . collect :: < Vec < _ > > ( ) ; res . push ( cols ) ; } } std :: fs :: remove_file ( output_path ) ? ; Ok ( res ) }
Parse an xslx file by the horrible convoluted method of running libreoffice to convert it
into a csv file in the temporary directory, reading that into an array of strings, and
then deleting the csv file.
Parse an xslx file by the horrible convoluted method of running libreoffice to convert it into a csv file in the temporary directory reading that into an array of strings and then deleting the csv file .
path
&PathBuf
path
&PathBuf