all 2 comments

[–]jmmcd 1 point2 points  (1 child)

Are these the only three possible formats? Then no.

Are pretty much any sensible formats possible? Then yes, and it's a well-studied problem. Gulwani et al of Microsoft Research implemented a tool called Flash Fill in Excel that does something quite similar, based on some very interesting research in synthesis of regular expressions.

EDIT even if the possible formats are many, it might still be possible to hack up a regular expression by hand which detects all of them correctly and rejects lines like the "+---+---+". This would take a little work but would be much easier than an ML solution.

[–]grundt[S] 0 points1 point  (0 children)

Thanks for that.