Line based text parser.

https://img.shields.io/github/last-commit/jfjlaros/textparser.svg https://github.com/jfjlaros/textparser/actions/workflows/arduino-package.yml/badge.svg https://readthedocs.org/projects/arduinotextparser/badge/?version=latest https://img.shields.io/github/release-date/jfjlaros/textparser.svg https://img.shields.io/github/release/jfjlaros/textparser.svg https://www.ardu-badge.com/badge/textparser.svg https://img.shields.io/github/languages/code-size/jfjlaros/textparser.svg https://img.shields.io/github/languages/count/jfjlaros/textparser.svg https://img.shields.io/github/languages/top/jfjlaros/textparser.svg https://img.shields.io/github/license/jfjlaros/textparser.svg

This library provides a simple way to parse line based data.

Features:

  • Easy to use.

  • Support for all types of delimiters and line endings.

  • Support for arbitrary boolean value notation.

  • Support for categorical data.

  • Support for integers in any base.

  • Tiny overhead compared to dedicated solutions.

  • Type safe.

Please see ReadTheDocs for the latest documentation.

Quick start

A TextParser object is initialised with a delimiter, which can consist of more than one symbol.

#include <textparser.h>

TextParser parser(", ");  // Delimiter is a comma followed by a space.

If all fields are of the same type, we can use an array.

int a[5];
parser.parseLine("1, 2, 3, 4, 5", a);

If the fields have different types, we can use multiple variables.

char a[4];
int b;
double c;
parser.parseLine("one, 2, 3.4", a, b, c);