Hi everyone,
I have a Word document with lots of text which I need to add as a tab to an existing Excel document using SAS.
I came up with an approach that I thought would work:
1. Save the Word doc as a text file (.txt)
2. Read into SAS as a SAS dataset with a long variable called Label to hold all the text in each line.
3. Add a variable called Start which is a record counter.
4. Use PROC FORMAT with CNTLIN to make a format out of those values.
5. Output to Excel a dataset of numbers 1-(number of records) that are formatted using the format in 4.
But then I remembered that the original Word document has a flowchart/image in the middle of the document. This obviously complicates things, so now I'm not sure what the best approach would be.
Any help is much appreciated.
I have no clue why you think SAS should be involved with this.
If I thought I needed such I would try copy and paste the whole Word doc into Excel. Reformat the column all the text will end up in.
May need a separate copy/paste for the image to get in a desirable location.
If the document has any tables you might have lots of fun just getting the text read.
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.