substr doesn't search at all. I suppose you meant index?
In reply to Re^3: Reading text file with <CR> line endings by hippo in thread Reading text file with <CR> line endings by Marshall