JuliaStats/DataFrames.jl — pull request #443 by davidavdav (2013-12-12 07:47:52+00:00)
Title: Added support for whitespace-delimited input to readtable()

This patch makes the option separator=' ' to readtable() behave like the input is whitespace delimited. Whitespace-delimited text files are very common in unix processing, they're an intermediate between human readable and machine readable representations. I would want to make the case that "a b" and "a b" should be treated similarly, I think it is generally a bad idea to add semantics to varying amounts of whitespace (unlike the designers of fortran and python...).

Fields are separated by any combinations of ' ' and '\t'. '\n' and '\r' still are line separators.

With skip_white::Bool we keep track of leading spaces, trailing spaces are covered by inspection of nextchr. Intermediate spaces are covered by inspecting nextchr, and simply not storing anytything if nextchr and chr are both either ' ' or '\t'.