Updated reader function: memory optimization - parse only header and lines with relevant dates