autofill @id when it's not given. This requires read ahead in the file, so files will be read into a list.