Thread overview
Read a text file at once for regex searching
Mar 20, 2023
Paul
Mar 20, 2023
Adam D Ruppe
Mar 20, 2023
Paul
March 20, 2023

I've been looking through our Library documentation and having trouble finding what I want. I'd like to read a text file in all at once and do some searching and analytics on it instead of reading it bit by bit or line by line. Do we have some such function in our std library?

Thanks in advance.

March 20, 2023
On Monday, 20 March 2023 at 17:42:17 UTC, Paul wrote:
> Do we have some such function in our std library?

Try

static import std.file;
string s = std.file.readText("filename.txt");


http://phobos.dpldocs.info/std.file.readText.html


March 20, 2023
On Monday, 20 March 2023 at 17:47:19 UTC, Adam D Ruppe wrote:
> On Monday, 20 March 2023 at 17:42:17 UTC, Paul wrote:
>> Do we have some such function in our std library?
>
> Try
>
> static import std.file;
> string s = std.file.readText("filename.txt");
>
>
> http://phobos.dpldocs.info/std.file.readText.html

Thanks Adam.