Visually compare text by dragging

Jul 07, '10 07:30:00AM

Contributed by: djdawson

I often want to compare two blocks of text, such as the output of various Terminal commands, the CLI configs of a pair of devices such as routers, switches, or firewalls, and also file checksums.

I've found that one very easy way to do this with smaller blocks of text is to simply highlight one of the blocks of text and then drag it on top of the other block (sometimes it's necessary to click and hold on the text for a moment before dragging it). Since the dragged-over text is displayed in a semi-transparent way, when it's aligned correctly over the other block of text it's quite obvious where any differences are. Once the visual comparison is complete I just hit the Escape key to cancel the drag & drop operation, though this isn't necessary if the destination app in question doesn't accept drag & drop text input.

Obviously the fonts should be the same and the same size for this to work the best, but that's usually the case in the Terminal and with most my TextEdit docs, or within a single app such as a Safari or Firefox web page. It's also most useful for small blocks of text that are completely visible all at the same time, since scrolling the dragged text isn't possible in mid-drag as far as I can tell. For larger comparisons I still use FileMerge, but for small quick comparisons this works well for me, and it seems to work in most apps.

[crarko adds: I tested this using TextEdit, and it works as described. It's somewhat more difficult to do using a trackpad.]

Comments (9)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20100706115746922