BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Stalk
Pyrite | Level 9

I have about 300 excel files on server and need to read only 30 files with specific word ( For ex: \\temp\reach\*conc_v.xlsx ) and append them to create one big dataset.

When I see them on windows, I cannot see their file extension .xlsx.   Also, I have to read the file name as first or last field so that I can concat to extract one piece of information from each file to use as title for my graph.

Any thought or leads with examples?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Stalk
Pyrite | Level 9

Thank you Kurt. I changed the properties in the control panel to show the file extensions. Unfortunately I have to read .xlsx files only not .csv or .txt. found a work around to process all the files. Your paper is very helpful to review lot of steps.

View solution in original post

3 REPLIES 3
Kurt_Bremser
Super User

Change the settings of Windows Explorer so that it does not suppress the file extensions.

 

If you want to list a directory from within SAS, use the DOPEN, DNUM and DREAD functions. See my WUSS presentation for examples.

You will need to run the import code for Excel files repeatedly.

If you had text files instead, you can read them into the dataset in one DATA step.

Stalk
Pyrite | Level 9

Thank you Kurt. I changed the properties in the control panel to show the file extensions. Unfortunately I have to read .xlsx files only not .csv or .txt. found a work around to process all the files. Your paper is very helpful to review lot of steps.

Tom
Super User Tom
Super User

Turn off whatever option it is in Windows Explorer that is hiding the file extensions.

Windows does try to use different icons for different file extensions.  But they are often very similar (or even the exact same) for different extensions.

 

Tom_0-1688061430211.png

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 615 views
  • 0 likes
  • 3 in conversation