Does something like std.algorithm.iteration:splitter with multiple seperators exist?

ParticlePeter via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 23 08:27:31 PDT 2016


On Wednesday, 23 March 2016 at 14:20:12 UTC, Andrea Fontana wrote:
> Any input => output example?

Sure, it is ensight gold case file format:

FORMAT
type:  ensight gold

GEOMETRY
model:                   1                        exgold2.geo**

VARIABLE
scalar per node:         1     Stress             exgold2.scl**
vector per node:         1     Displacement       exgold2.dis**

TIME
time set:                      1
number of steps:               3
filename start number:         0
filename increment:            1
time values:       1.0   2.0   3.0


The separators would be ["FORMAT", "TIME", "VARIABLE", 
"GEOMETRY"].
The blank lines between the blocks and the order of the 
separators in the file is not known.
I would expect a range of four ranges of lines: one for each 
text-block above.




More information about the Digitalmars-d-learn mailing list