1, I have multiple unstructured log files with different formats/Type of file i.e, : .log, .GTI, .txt files
2. I want to read them all into a single data step eg: file1.log, file2.GT1, file3.txt into a single data set.
3. I tried to import them using "infile 'C:filepath\*.log" but I will be missing the files from other formats. Is there a way to upload all of them at once?
If you want to ALL files in the directory then 'C:\path\*.*' if just the explicit extenstions then place the diffent file name bits within parentheses and use quotes such as
infile ('C:\path\*.log' 'C:\path\*.gti' 'c:\path\*.txt')
When getting something a bit off like this I tend to use a FILENAME statement to create a reference to my input files as then any of the actua INFILE options are easier to find.
If you want to ALL files in the directory then 'C:\path\*.*' if just the explicit extenstions then place the diffent file name bits within parentheses and use quotes such as
infile ('C:\path\*.log' 'C:\path\*.gti' 'c:\path\*.txt')
When getting something a bit off like this I tend to use a FILENAME statement to create a reference to my input files as then any of the actua INFILE options are easier to find.
I think, the INFILE statement (unlike the FILENAME statement) requires additional quotes around the parenthesized list:
infile "('C:\path\*.log' 'C:\path\*.gti' 'c:\path\*.txt')";
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.