|
|||||||
| Register | FAQ | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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.
|
|
#4
|
|||
|
|||
|
The best way to automate just the text content itself would be to use the XML report.
__________________
Aaron P Scooter Software |
![]() |
| Thread Tools | |
| Display Modes | |
|
|