reading file byLine

Namal via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 3 16:38:54 PDT 2015


On Thursday, 3 September 2015 at 23:31:27 UTC, Jordan Wilson 
wrote:
> On Thursday, 3 September 2015 at 23:28:37 UTC, Namal wrote:
>> On Thursday, 3 September 2015 at 23:25:52 UTC, Jordan Wilson 
>> wrote:
>>> And also:
>>> import std.algorithm
>>>
>>> Sorry, I should have taken the time to answer properly and 
>>> fully.
>>
>> import std.file, std.stdio, std.string, std.conv, 
>> std.algorithm;
>>
>> void main(){
>>
>> 	auto file = File("text.txt");
>> 	auto numbers = file.byLine()
>>                  .map!(a => a.split)
>>                  .map!(a => map!(a => to!int(a))(a))
>>                  .array();
>> 	
>> 	writeln(numbers);
>> }
>>
>> Error: no property 'array' for type 'MapResult!(__lambda2, 
>> MapResult!(__lambda1, ByLine!(char, char)))'
>>
>> Still an error.
>
> import std.array

Thx, finaly, this is so much harder to understand than c++ 
iostream



More information about the Digitalmars-d-learn mailing list