extract-strings

Crates.ioextract-strings
lib.rsextract-strings
version0.4.0
created_at2024-12-31 18:06:58.223586+00
updated_at2025-01-04 14:22:10.879877+00
descriptionExtract ascii strings from files
homepage
repositoryhttps://github.com/orf/archive-to-parquet
max_upload_size
id1500239
size9,292
Tom Forbes (orf)

documentation

README

Extract strings

A small utility to extract ascii strings from binary content.

Usage

use std::io::{BufReader, Write};
use extract_strings::AsciiStrings;

fn main() {
    let path = std::env::args().nth(1).expect("no path provided");
    let file = std::fs::File::open(path).expect("failed to open file");
    let reader = BufReader::new(file);

    let mut total = 0;
    for string in reader.iter_ascii_strings(10) {
        println!(out, "{}", string).unwrap();
        total += 1;
    }
    println!(out, "Total strings: {total}").unwrap();
}
Commit count: 241

cargo fmt