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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

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