Reading files using delimiters/terminators

Rekel paultjeadriaanse at gmail.com
Sun Dec 27 00:13:30 UTC 2020


I'm trying to read a file with entries seperated by '\n\n' (empty 
line), with entries containing '\n'. I thought the 
File.readLine(KeepTerminator, Terminator) might work, as it seems 
to accept strings as terminators, since there seems to have been 
a thread regarding '\r\n' seperators.

I don't know if there's some underlying reason, but when I try to 
use "\n\n" as a terminator, I end up getting the entire file into 
1 char[], so it's not delimited.

Should this work or is there a reason one cannot use byLine like 
this?

For context, I'm trying this with the puzzle input of day 6 of 
this year's advent of code. (https://adventofcode.com/)


More information about the Digitalmars-d-learn mailing list