Compare files, folders, text, pdf's, word docs and excel sheets. Includes file and folder merge features. Free 30 day trial.
Compare two versions of a document. Open one of the two versions of the document that you want to compare. On the Tools menu, point to Track Changes, and then click Compare Documents. In the Original document list, select the original document. In the Revised document list, browse to the other version of the document, and then click OK. Araxis Merge is a three-way document comparison, merging, and folder synchronization tool. It can be used to compare source code, web pages, XML, and other text files, as well as Word and Excel documents, PDFs, and RTF files. It’s available for both Windows and Mac OS X for $129 for the Standard version and $269 for the Professional version.
Mac Text File
Click here to return to the 'Compare two Mac-formatted text files' hint |
File Compare For Mac
Go and look at http://www.gregor.com/dgregor/csh_whynot.html for why you shouldn't be using csh for scripting.
Here's my version (using bourne shell programming of course) that's even more fancy. (Replace <BACKSLASH> with a backslash)
#!/bin/sh
# mdiff:
# Provides the equivalent of 'diff' for comparing files
# that use the traditional Macintosh line ending: r
# So people don't make weird versions of printf, diff, rm etc. run
PATH=/bin:/usr/bin:$PATH
# Print the usage and exit
usage()
{
diff -h
printf 'Usage: %s [ -bcefhintwlrs ] file1 file2' `basename $0`
exit 2;;
}
# Cleanup when exiting
cleanup()
{
rm '$ufile1' '$ufile2'
exit;
}
# pass on arguments to diff except for h (print help)
while getopts bcefhintwlrs arg; do
case $arg in
<BACKSLASH>?) usage;;
h) usage;;
?) args='$args -$arg';;
esac
done
shift `expr $OPTIND - 1`
# We need 2 arguments
[ $# -ne 2 ] && usage
mfile1='$1'
mfile2='$2'
# We create temporary files ufile1 & ufile2 with r changed to n
ufile1='/tmp/mdiff$$.1'
ufile2='/tmp/mdiff$$.2'
tr 'r' 'n' <'$mfile1' >'$ufile1'
tr 'r' 'n' <'$mfile2' >'$ufile2'
# Remove the temporary files when exiting (via Ctrl+C or normal exit or kill etc.)
trap 'cleanup' 0
# Do the diff
diff $args '$ufile1' '$ufile2'
You should also try FileMerge in the Developer tools. Its is a (great) GUI tool to compare and merge files... and it works with any type of file.
Compare Two Text Files Mac
Filemerge is indeed better than diff because it displays a nice side by side comparison of the two files with a visual display of the differences, and then allows you to merge the files if you want. However, I found that it crashes if you use it on files with Mac end of line characters - I needed to compare two database files produced by Gene, a family history application which I have to run in Classic.
If you have files like that, you need to use tr to convert the end of line characters before you can run Filemerge on them. It's not really worth a shell script; just go to the terminal and navigate to the directory in which your files are saved, then enter:
tr 'r' 'n' <filename >tempfilename
where filename is the name of your first file and tempfilename is a name of your choice for the converted file.
Do the same thing again for the second file, then run FileMerge (it's in Developer/Applications if you have installed Developer Tools), choosing your two temporary files to compare.
After merging the files, replace the original end of line characters:
tr 'n' 'r' <mergefilename >newmergefilename
where mergefilename is the name you chose when saving the merged file in Filemerge and newmergefilename is your chosen name for the final, merged file with the original end of line characters, ready to view in your Classic application. You will probably also have to change the filetype and creator depending on whether your application can recognise the merged file.