frictionlessdata / datapackage

Data Package is a standard consisting of a set of simple yet extensible specifications to describe datasets, data files and tabular data. It is a data definition language (DDL) and data API that facilitates findability, accessibility, interoperability, and reusability (FAIR) of data.
https://datapackage.org
The Unlicense
481 stars 109 forks source link

rtrim field attribute #891

Open fomcl opened 4 months ago

fomcl commented 4 months ago

An rtrim attribute could be added to a Field, to indicate that trailing whitespace may be removed.

roll commented 2 months ago

I think it might be Table Dialect property similar to https://datapackage.org/specifications/table-dialect/#skipinitialspace

nichtich commented 2 months ago

Use case Gremlin Load Data Format with this rule:

Surrounding spaces between delimiters are ignored. If a row is present as value1, value2, they are stored as "value1" and "value2".

The new configuration attribute could be named skipFinalSpace to also trim value1 ,value2 to "value1" and "value2".

By the way the definition of skipInitialSpace should be extended to also cover leading witespace before the first field and it should better define "whitespace".