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
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.
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.
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.
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.
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!
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.