UBOdin / mimir

Data-ish exploration through SQL+Uncertainty
http://mimirdb.info
Apache License 2.0
26 stars 13 forks source link

Fixed-width-format data inputs #336

Open okennedy opened 4 years ago

okennedy commented 4 years ago

Some files use a fixed-width format.

foo    1    2019-01-02
barbaz 231  2019-12-01

It would be handy to be able to parse these in. As part of the configuration, you'd need column widths. For example:

LOAD DATASET bla AS FIXED(name = 7, amount = 6, year = 4, skip(1), month = 2, skip(1), day = 2)

or using regexp

LOAD DATASET bla AS REGEXP("(.{6}) (.{5}) ([0-9]{4})-([0-9]{2})-([0-9]{2})", SCHEMA(name, amount,  year, month, day))
okennedy commented 4 years ago

70 or something like it might be a better thing to do here.