how to compare 2 RTF files

Reply
Occasional Contributor
Posts: 11

how to compare 2 RTF files

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?

Valued Guide
Posts: 596

Re: how to compare 2 RTF files

Posted in reply to ajaybetham

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

Occasional Contributor
Posts: 11

Re: how to compare 2 RTF files

Posted in reply to ChrisBrooks

how to compare 2 RTF files programmatically

Valued Guide
Posts: 596

Re: how to compare 2 RTF files

Posted in reply to ajaybetham

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?

Super User
Posts: 5,919

Re: how to compare 2 RTF files

Posted in reply to ajaybetham

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
Occasional Contributor
Posts: 11

Re: how to compare 2 RTF files

That makes sense. I found some Java utils to compare RTF files. will go with Java.
Ask a Question
Discussion stats
  • 5 replies
  • 398 views
  • 0 likes
  • 3 in conversation