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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.