How to read blocks or sections one by one from a txt file?

Is there a read block function besides readline and readlines, or more powerful function of them according a separate symbol.

Such as: readline("*.txt", separate=">") # Change the default="\n" into “>”

Maybe https://docs.julialang.org/en/v1/base/io-network/#Base.readuntil would meet your needs?

1 Like

The readuntil will stop at the first delimiter or include delimiter itself by keep=true, and it seems working only in one line. So it is hard to realize my task.

My task is:
How to read the sections by given delimiter one by one till the end of file ?

Try CSV.Rows

I think @quinnj is working on a chunk-by-chunk API, I think