fileio_handle

Crates.iofileio_handle
lib.rsfileio_handle
version0.1.0
created_at2025-07-15 12:09:11.030033+00
updated_at2025-07-15 12:09:11.030033+00
descriptionSimple "easy" file handler
homepage
repositoryhttps://github.com/amyoshi-hub/Rust_lib/tree/main/fileio-handle
max_upload_size
id1753184
size6,765
amyoshi (amyoshi-hub)

documentation

README

simple file handler

A minimal file handling utility written in Rust You can easily read and write text files, and extract numeric values using customizable separators.

main code

fn main() -> Result<(), Box<dyn std::error::Error>>{

    let mut file = FileIO::new("word_list.txt");
    file.read_lines()?;
    
    let sep_list = [":", "|"];
    let mut result = Vec::new();

    for line in &file.contents {
        let split = FileIO::phaser(line, &sep_list);
        let filtered: Vec<_> = split
            .iter()
            .filter(|s| s.trim().parse::<f32>().is_ok())
            .cloned()
            .collect();
        let joined = filtered.join(", ");
        result.push(joined);
    }

    FileIO::write_file("out.txt", &result)?;
    
    Ok(())
}
      

planning features

  • better error handling
  • json, csv support
  • cli support
  • library export
Commit count: 0

cargo fmt