BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Aj
Fluorite | Level 6 Aj
Fluorite | Level 6

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? 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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.

 

View solution in original post

4 REPLIES 4
ballardw
Super User

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.

 

FreelanceReinh
Jade | Level 19

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')";

Aj
Fluorite | Level 6 Aj
Fluorite | Level 6
This worked for me too. Thank you very much
Aj
Fluorite | Level 6 Aj
Fluorite | Level 6
Thanks ballard. I used the filename to get the names of all the files I imported.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 979 views
  • 1 like
  • 3 in conversation