I have a list in txt format (list.txt) and I want Stata to read the list one line at a time (each line is the name of a dataset in ASCII format that I want to open and save as dta). My code is:
But Stata keeps returning the error "invalid file specification". I tried display `line' and line is apparently empty... However, I tried
once more and display shows me that Stata is reading the second line and insheet works with no errors.... Any ideas as to why Stata is reading my first line as if it were blank?
Code:
file open myfile using "list.txt", read file read myfile line insheet using `line', delimiter(";")
Code:
file read myfile line
Comment