Bug introduced in 10.0 and fixed in 10.3.0
Create a file
temp.txt with the following content:
test1 ;;; test2 ;;; test3 ;;;
Treating the semicolon sequence as terminator, try to repeatedly read to the first terminator.
Table[ReadString["temp.txt", "\n;;;"], 6]
Contrary to my intent, this does not create a list holding "test1" 6 times. Instead, it keeps reading the file to the next terminator, and starts over when it reached the end-of-file.
- How can I understand the documentation to imply this behavior?
- Is there a stream object hiding somewhere? (It is not listed by
Streams.) If so, can it be closed?
- How can I most simply achieve the desired behavior? (Most simply means something more aesthetic than the following.)
Table[x = ReadString["C:/temp/temp.txt", ";;;"]; ReadString["C:/temp/temp.txt"]; StringTrim[x], 6]