[−][src]Crate rustsv
What is RustSV?
RustSV (referred to as RSV) is a CSV parser, built for the modern age.
It focuses on usability, and has the advantage of not requiring the use of Serde to parse your files into a programmatically readable structure.
See the source code here
Found a bug? report it!
Basic usage:
Parsing a string:
use rustsv::prelude::*; // Create our input data let input: &str = "surname,initial,address,phone number\ Smith,A,\"14 Made up Drive, Made up City, Ohio\",216-235-3744\ Doe,J,\"15 Fake Street, Phonyville, Texas\",210-214-5737"; // Parse the `input` into `Content` // The parameters are as follows: // 1. Input: String - The text you wish to parse // 2. Delimiter: Char - The character to delimit by // 3. Headers: Bool - If the parser should use the first row in the file as headers let content: Content = parse(input, ',', true);
The above method will provide an instance of Content
Parsing a file:
// Parse the `input` into `Content` // The parameters are as follows: // 1. Input: String - The text you wish to parse // 2. Delimiter: Char - The character to delimit by // 3. Headers: Bool - If the parser should use the first row in the file as headers let content: Content = read("path/to/file.csv", ',', true)?;
The above method will provide a result containing an error, or Content
Modules
prelude | |
structs |
Functions
parse | Parses the provided String into an instance of |
read | Reads a file and parses it into an instance of |