[−][src]Function rustsv::read
pub fn read<A>(
path: A,
delimiter: char,
has_headers: bool
) -> Result<Content, Box<dyn Error>> where
A: Into<String>,
Reads a file and parses it into an instance of Content
The method takes a path to a file, and then deconstructs the data, turning it into a special, serialization free structure Content
path
the path to the file
delimiter
The delimiter used in the data, for example a pipe (|
) or a tab (
)
has_headers
If the data's first line contains the titles of each column or not
Examples
Note: this code is correct at the time of documentation, it has the
no_run
tag to ensure the doc tests do not fail due to an unavoidable IO Error Basic usage:
use rustsv::prelude::*; // Parse the `input` into `Content` let content: Content = read("./path/to/file.csv", ',', true)?;