Hi all,
I wanted to write a sas code which could have defined number of the cells(variables) in rtf report and the lengths of each cell. Could you please provide any recommendations/links.
Thank you.
When you have attributes details, variables with fixed length.
That is the question - I have just file and do not know the lengths.
@DmytroYermak you need to post more details of what you’re trying to do.
RTF files are for word processor text. You need to scan the rtf text for tags that indicate tabular data, and then try to extract the cell values from that.
The wikipedia article on the rtf file format will give you hints how hard this will be.
RTF files are even less suited for SAS data input than Excel files.
@DmytroYermak wrote:
Thank you! Do you know "the tags that indicate tabular data"?
No. Best you can do is to create a rtf file with data as you expect it, and then inspect the contents of the file with a pure text editor.
For one shot deals, I can sometimes open the rtf file in Word, copy the material I want to the clipboard and then paste it into a raw text processor. Then read it from there with SAS.
@PGStats wrote:
For one shot deals, I can sometimes open the rtf file in Word, copy the material I want to the clipboard and then paste it into a raw text processor. Then read it from there with SAS.
Or (shudders) paste into Excel. And save as CSV for import.
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.