Suliman
Suliman

Reputation: 1509

D: byLine with remove (http) file?

I need to split remote file byLine with D. http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv

The examples show only how to work with files on FS. But can I work with remote files?

Upvotes: 1

Views: 60

Answers (1)

yaz
yaz

Reputation: 1330

You can use std.net.curl.byLine.

Example:

void main()
{
    import std.net.curl, std.stdio;

    string link = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv";
    foreach (line; link.byLine())
    {
        writeln(line);
    }
}

Upvotes: 2

Related Questions