BookmarkSubscribeRSS Feed
ajaybetham
Calcite | Level 5

I am researching on how to compare 2 RTF files. There are many solutions. I don't find the one I am looking for. 

My thought process was to convert the 2 RTF files into 2 datasets and compare the datasets using proc compare. Is this the right approach. If yes, how to convert a RTF file to Sas dataset?

5 REPLIES 5
ChrisBrooks
Ammonite | Level 13

A lot depends on the layout of your RTF files - there's a paper here -> http://www2.sas.com/proceedings/sugi31/066-31.pdf describing one method. On the other hand if you have a simple RTF you could open it in Word and copy/Paste it into Excel then save the Excel file as a CSV which would be easy to import into SAS

ajaybetham
Calcite | Level 5

how to compare 2 RTF files programmatically

ChrisBrooks
Ammonite | Level 13

That’s a much more complex problem - you could open them and read them byte by byte but what if they differ in a trivial way e.g. an extra blank line in one of the files? Would younwant the comparison to re-synchronise?

LinusH
Tourmaline | Level 20

Why use SAS for this? 

SAS is great for working with data, not document objects.

I'm pretty sure that there are other 3rd party tools out there that can do that kind of comparisons (and then perhaps SAS can read the output from that...).

A Google search give me 542K results....

Data never sleeps
ajaybetham
Calcite | Level 5
That makes sense. I found some Java utils to compare RTF files. will go with Java.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 5 replies
  • 3368 views
  • 0 likes
  • 3 in conversation