CSV Tools
A Rust crate to easily read, manipulate and create CSV files, supporting double quotes and escaped characters.
How to use
See the documentation in crates.io for further information about the individual methods of the crate.
As of now this crate doesn't use any external dependencies.
Simple overview
Here a basic overview with the following example (langs.csv):
language,level_of_fun,level_of_difficulty
C++,10,8
Rust,10,9
JavaScript,9,1
TypeScript,10,1
Java,0,2
HTML,10,-1
GDScript,10,1
Lua,7,1
Read the file:
use CSVFile;
let filename = Stringfrom;
let file = new?;
assert_eq!;
assert_eq!;
A lot of utility methods are here to help you manipulate the data more easily:
// continuing with the above example
// ...
use CSVCoords;
// get the value at specific coordinates
assert_eq!;
Map your CSV to a data structure
// continuing with the above example
// ...
// mapped_rows is a vector of Language.
let mapped_rows = file.map_rows;
assert_eq!;
assert_eq!;
You also have methods such as:
find_textcheck_validitytrim_endtrim_starttrimmerge(for merging CSV files)- ...