Crates.io | rust-csv |
lib.rs | rust-csv |
version | 0.1.0 |
source | src |
created_at | 2024-09-03 08:23:20.866136 |
updated_at | 2024-09-03 08:23:20.866136 |
description | CSV file read & write using pure rust code. |
homepage | |
repository | |
max_upload_size | |
id | 1361465 |
size | 10,851 |
CSV file read & write using pure rust code.
To get started with the CSV handling crate in Rust, you'll first need to add the rust-csv
crate to your project. You can do this by adding it to your Cargo.toml
:
cargo add rust-csv
CSV File Read & Write Support: Provides functionalities for reading from and writing to CSV files.
High Performance: Optimized for fast reading and writing operations.
Vector-Like Syntax: Offers a simple and intuitive API for working with CSV data.
Memory Safe & Efficient: Ensures safe and efficient memory management in accordance with Rust's guarantees.
IO Support: Handles input and output operations for CSV files.
CSV File Manipulation: Allows for easy manipulation and transformation of CSV data.
fn main() -> io::Result<()> {
// Read CSV File.
let csv_file = CsvFile::read("me.csv")?;
println!("{csv_file}");
// Get All Columns Data.
let cols = csv_file.cols("Name").unwrap();
println!("cols: {cols:?}");
// Write CSV File.
let mut new_csv = CsvFile::new();
new_csv.push_head("Name");
new_csv.push_head("Email");
new_csv.push_head("Number");
new_csv.push_row(&[
"Md Mahi Kaishar",
"mahikaishar@gmail.com",
"+880-14003-14120",
]);
new_csv.write("new.csv")?;
Ok(())
}
Contributions are welcome! I would like you to contribute in this project.
This project is in its early stages, and there are many missing features that need implementation. Check the Issues section for a list of features, enhancements, and bug fixes that are planned.
This project is licensed under the MIT License - see the LICENSE file for details.