Go Back   Scooter Forums > Beyond Compare 3 Discussion > Scripting
Register FAQ Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 15-Jun-2012, 09:36 PM
tzetlan tzetlan is offline
New User
 
Join Date: Jun 2012
Posts: 2
Default Compare two text files

I have two text files. I want to compare the two text files and generate a new text file which only contains the differences from the right file. I am new to the scripting and cannot figure out how to accomplish this. For example:

Left file contains:
test1
test2
test3

Right file contains
test1
test5
test3
test4

Resulting file should contain:
test5
test4

Can this be done through scripting?
Reply With Quote
  #2  
Old 18-Jun-2012, 08:23 AM
Aaron Aaron is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 5,444
Default

Hello,

You could generate a Text Report using BC Scripting. It would not be just the different text, but could be defined to show only differences (and would include a report header, or xml, depending on the report picked). I would suggest using the graphical interface, load your two files, then use the Session menu -> Text Compare Report dialog. Once you have found the report that most closely meets your needs, you can define a script to generate the same report.
__________________
Aaron P Scooter Software
Reply With Quote
  #3  
Old 18-Jun-2012, 10:47 AM
tzetlan tzetlan is offline
New User
 
Join Date: Jun 2012
Posts: 2
Default

Thank you for your response. Based upon playing with the UI, it looks like I could produce the XML report and then apply an XSLT to pull out the appropriate statuses: different, rightorphan, and similar. I will try this out unless there is an easier way. Via the UI, I can do a compare, only show differences and then copy the content from the right pane to a new file. Looking to automate this.
Reply With Quote
  #4  
Old 19-Jun-2012, 03:48 PM
Aaron Aaron is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 5,444
Default

The best way to automate just the text content itself would be to use the XML report.
__________________
Aaron P Scooter Software
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:16 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.