File.readf

uint readf(alias format, Data...)(auto ref Data data) if (isSomeString!(typeof(format)))

Reads formatted _data from the file using formattedRead.

Parameters

formatThe format string. When passed as a compile-time argument, the string will be statically checked against the argument types passed.
dataItems to be read.

Returns

Same as formattedRead: The number of variables filled. If the input range r ends early,

this number will be less than the number of variables provided. Example: ---- // test.d void main() { import std.stdio; auto f = File("input"); foreach (_; 0 .. 3) { int a; f.readf!" %d"(a); writeln(++a); } } ----

% echo "1 2 3" > input

% rdmd test.d 2 3 4

uint readf(Data...)(scope const(char)[] format, auto ref Data data)

ditto