csv_parser_moshkovskyi 0.1.0

CSV parser built with Pest parser for Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# CSV_PARSER_MOSHKOVSKYI

Realisation of basic csv parser
# Technical description

This parser is parsing a csv file.
He will parse file, show it in structured way and check file on correctnes.
# Usage

The result can be used for basic data analytics
# Grammar

WHITESPACE = _{ " " | "\t" | "\n" | "\r" }
NEWLINE = _{ "\n" | "\r\n" }
csv = { (WHITESPACE | NEWLINE)* ~ record ~ (NEWLINE ~ record)* ~ (WHITESPACE | NEWLINE)* }
record = { field ~ ("," ~ field)* }
field = { empty_field | quoted_field | unquoted_field }
empty_field = _{ "," }
quoted_field = _{ "\"" ~ (!"\"" ~ ANY | "\"" ~ "\"")* ~ "\"" }
unquoted_field = _{ (!("," | NEWLINE | " ") ~ ANY)+ }