slurp

fnSelect!(Types.length == 1, Types[0][], Tuple!(Types)[]) slurp(Types...)(string filename, scope const(char)[] format)

Reads a file line by line and parses the line into a single value or a

Tuple of values depending on the length of Types.

The lines are parsed using the specified format string. The format string is passed to formattedRead, and therefore must conform to the _format string specification outlined in std._format.

Parameters

Typesthe types that each of the elements in the line should be returned as
filenamethe name of the file to read
formatthe _format string to use when reading

Returns

If only one type is passed, then an array of that type. Otherwise, an

array of Tuples.

Throws

Exception if the format string is malformed. Also, throws Exception

if any of the lines in the file are not fully consumed by the call to formattedRead. Meaning that no empty lines or lines with extra characters are allowed.