I'm attempting to import data from a number of log files. Here's how I'm approaching it:
I have the log files in a separate directory and I generate a txt file with the list of filenames in that directory. I then read through that txt file and subsequently use the filenames in a loop with an import command to bring the data in. This process worked when I last run the do file about 6 months ago and now it's not working.
The basics of the code look like this:
cd "filepath\logs\"
! dir cpuusage*.log /a-d /b /o:-d >"filepath\filelist.txt"
file open myfile using "filepath\filelist.txt",read
file read myfile line
import delimited using `line', delim(" ") varnames(nonames)
The result of that import command is (0 vars, 0 obs) despite the fact that filelist.txt has a list of 14 filenames.
I'm a novice so I'm really hoping there's something simple and obvious that I'm overlooking. I still don't understand why this exact method worked six months ago... Any thoughts?
"`line'". - user4690969importcommand was accepted as legal but thinks it found an empty file. It's hard to understand that without seeing your files. Try typing the file usingtypejust before you try toimport. - Nick Cox