Friday, June 29, 2018

Re: Perform diff as exact line match

On 2018-06-29, Joseph L. Casale wrote:
> On Thursday, June 28, 2018 at 7:46:51 PM UTC-6, Tony Mechelynck wrote:
> > No plugin required, provided that you have a Vim compiled with +diff
> > and that the diff utility is installed and can be found on your $PATH.
> >
> > See ":help diff.txt"
>
> Hi Tony,
> Specifically, I need to match lines completely ignore partial differences.
> I have the most recent version of vim with a diff utility, however I do not
> see anything diff.txt or diffopt that allows me to specify matches must be
> complete lines and not partial.
>
> I am trying to compare collections of strings, where I am not interested in
> similar items, only exact. The collections are sorted so I want to see
> filler where an exact line match is not found.

I _think_ I understand what you want, but I don't know of a way to
make Vim's internal comparison algorithm do that.

Either of these two Linux commands will generate an output of only
the lines common to file1 and file2, if that helps.

diff --changed-group-format= file1 file2
comm -12 file1 file2

The comm command requires that the two files be sorted, but that's
what you have.

HTH,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment