[][src]Function data_reader::reader::parser::parse_txt

pub fn parse_txt(
    f: &str,
    params: &ReaderParams
) -> Result<RawReaderResults, Error>

parse_txt reads in a data file that is made up any type(s). It parses the data file finding all of the field data and saving off in its raw byte form. It can fail in a number of other ways related to invalid parameters or the data file having malformed fields. These errors are percolated up to whatever is calling this in the form of the Error type. One should therefore check to make sure no errors are obtained when examining the file. If a malformed field is seen the error does contain information about what line number of the data file has the malformed field.

Input -

f is simply the location of the file.

params is ReaderParams structure. An example for what this looks like can be found in the test directory.

Output -

A Result type that either contains a RawReaderResults structure or an error.