<div dir="ltr"><div>Hi Yuri,</div><div><br></div><div><span style="color:rgb(68,84,106)">Prashant (08/26): Thanks for the reply. But please answer the following:<u></u><u></u></span><p style="margin-right:0cm;margin-bottom:12pt;margin-left:54pt"><u></u><span style="color:rgb(68,84,106)"><span>i.<span style="font:7pt/normal "Times New Roman";font-size-adjust:none;font-stretch:normal">                    </span></span></span><u></u><span style="color:rgb(68,84,106)">In Windows environment, Is there any way that I can call Kdiff3 from command line + pass the </span>choose_a_everywhere option in the command line itself.<u></u><u></u></p><p style="margin-right:0cm;margin-bottom:12pt;margin-left:54pt"><span style="color:rgb(68,84,106)">Since such option is there in the front end tool, I am sure such option will be available through command line as well. Just that I would want to know the syntax.<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:12pt;margin-left:54pt"><span style="color:rgb(68,84,106)">Please advise. Also I am looking for a tool which can work both on Windows and Unix.<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:12pt;margin-left:54pt"><span style="color:rgb(68,84,106)">Is it possible to speak to you or any member from your team and get things clarified. Please share your contact no and availability time-slot, timezone. Thank you for all your support.<u></u><u></u></span></p></div><div class="gmail_extra"><br></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Prashant</div><div class="gmail_extra"><br></div><div class="gmail_quote">On Tue, Aug 23, 2016 at 6:13 PM, Yuri Chornoivan <span dir="ltr"><<a href="mailto:yurchor@ukr.net" target="_blank">yurchor@ukr.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><br>
23 серпня 2016, 14:30:16, від "Prashant Pahurkar" <<a href="mailto:prashant.pahurkar@gmail.com">prashant.pahurkar@gmail.com</a>>:<br>
<span><br>
>         Hi Yuri,<br>
><br>
><br>
><br>
>          <br>
><br>
><br>
><br>
>         Thanks for your reply.<br>
><br>
><br>
><br>
>         I have few questions/clarification as below:<br>
><br>
><br>
><br>
>                    <br>
><br>
>       1.    Yuri:- Anyway, KDiff3 (as any other KDE application) can be controlled with D-Bus. See the instructive article here:<br>
> <a href="http://www.linuxjournal.com/article/10455" target="_blank" rel="noreferrer">http://www.linuxjournal.com/<wbr>article/10455</a><br>
>  You can easily found merge_choose_a_everywhere in the KDiff3 D-Bus tree under kdiff3/MainWindow_1/actions and set it.<br>
>  Options can be passed through additional arguments to the Windows CALL.<br>
><br>
><br>
>         Prashant: I have gone through the link you have shared above but I am not very clear. My questions are :<br>
><br>
><br>
><br>
><br>
>         a.   <br>
><br>
>         Do I need to install D-Bus as well in my system to use choose_a_everywhere option before hand.<br>
<br>
</span>Oops... I have not tested this on Windows version of _KDiff3_ before writing the answer. I works for stock KDE applications from KDE-Windows and for Linux version of KDiff3 (tested on Win XP) but it does not work for KDiff3-Windows separate package (tested).<br>
<span><br>
><br>
><br>
><br>
><br>
>         b.   <br>
><br>
>         Once kdiff3 is launched and when I give 2 input files for merging, then I can choose a or b everywhere option but question is I need to understand how do I set such option via the command line. Pls advise.<br>
<br>
</span>It is impossible for the separate KDiff3 package on Windows. Now I know it.<br>
<span><br>
><br>
> 2.    Yuri: If you need non-interactive tool then why did you choose Kdiff3? Why not use its backend (diff3 from diffutils), fc from Windows or WinMerge command line part?<br>
><br>
><br>
>         Prashant: I tried using diff3 which got available as part of KDiff3 installation (in the kdiff3\bin folder)<br>
><br>
><br>
><br>
>         But I was unable to neither run the diff3 application directly nor via the batch file using Call command by passing file as parameters<br>
><br>
><br>
><br>
>         For eg:<br>
><br>
><br>
><br>
>         call "C:\Program Files\kdiff3\bin\diff3.exe" "C:\Users\xxx\Documents\Rnd Learning\n1.txt" “C:\Users\xxx\Documents\Rnd Learning\n2.txt" -o "C:\Users\xxx\Documents\Rnd Learning\n3.txt"<br>
><br>
><br>
><br>
>         Please advise on how do I use and invoke Diff3 which will merge 2 files (With File A code dominating) and returning the output in 3rd file. All this to be achieved through command line.<br>
<br>
</span>Please use the Linux tools as expected (there are man pages for the in the net).<br>
<br>
In this case I recommend diff + sed from \bin. First you use diff:<br>
<br>
call diff.exe -DVERSION1 file1.txt file2.txt > merged.txt<br>
<br>
then use sed.exe to separate needed part from the diff. The idea is stolen from here:<br>
<br>
<a href="http://unix.stackexchange.com/questions/63425/how-to-use-patch-and-diff-to-merge-two-files" target="_blank" rel="noreferrer">http://unix.stackexchange.com/<wbr>questions/63425/how-to-use-<wbr>patch-and-diff-to-merge-two-<wbr>files</a><br>
<br>
Some usefule recipes for sed can be found here:<br>
<br>
<a href="http://sed.sourceforge.net/grabbag/tutorials/" target="_blank" rel="noreferrer">http://sed.sourceforge.net/<wbr>grabbag/tutorials/</a><br>
<br>
Hope this helps,<br>
Yuri<br>
<br>
><br>
><br>
> Thanks.<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
>         Regards,<br>
><br>
><br>
><br>
>         Prashant<br>
<span>><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Fri, Aug 12, 2016 at 1:00 PM, Yuri Chornoivan  wrote:<br>
> > Hi,<br>
> ><br>
> ><br>
> > Please find some answers below.<br>
> ><br>
> ><br>
</span>> > написане Fri, 12 Aug 2016 09:39:32 +0300, Prashant Pahurkar :<br>
<span class="im HOEnZb">> ><br>
> > > Gentle reminder.<br>
> > ><br>
> > > Please reply if it is possible to have the required functionality.<br>
> > ><br>
> > ><br>
> > > Regards,<br>
> > ><br>
> > > Prashant<br>
> > ><br>
> > > On 11 Aug 2016 18:53, "Prashant Pahurkar"<br>
> > ><br>
</span><span class="im HOEnZb">> > > wrote:<br>
> > ><br>
> > > > Gentle reminder. ..<br>
> > > ><br>
> > > > Awaiting your reply.<br>
> > > ><br>
> > > ><br>
> > > > On 10 Aug 2016 16:46, "Prashant Pahurkar"<br>
> > > ><br>
</span><div class="HOEnZb"><div class="h5">> > > > wrote:<br>
> > > ><br>
> > > > ><br>
> > > ><br>
> > > > > Hi Burkhard,<br>
> > > ><br>
> > > > ><br>
> > > ><br>
> > > > > Thanks for the reply.<br>
> > > ><br>
> > > > > I have gone through the link you have shared but what I am looking out<br>
> > > ><br>
> > > > is somewhat different and is as follows:<br>
> > > ><br>
> > > > > 1. I want to merge 2 files and auto resolve the conflict without any<br>
> > > ><br>
> > > > manunal intervention.<br>
> > > ><br>
> > > > > Lets say I will provide the input as:- In Conflict situation it should<br>
> > > ><br>
> > > > always pick it up from File A and override.<br>
> > > ><br>
> > > > > Is it possible without manual intervention.<br>
> > > ><br>
> > > > > I guess this is possible by Manual intervention i.e. by choosing the<br>
> > > ><br>
> > > > option of selecting "Choose A from everywhere" - but how to achieve this<br>
> > > ><br>
> > > > without manual intervention.<br>
> > > ><br>
> > > > > It means how do I default or set the "Choose A from everywhere" option<br>
> > > ><br>
> > > > before hand.<br>
> ><br>
> ><br>
> > Hmm... If you need non-interactive tool then why did you choose Kdiff3? Why not use its backend (diff3 from diffutils), fc from Windows or WinMerge command line part?<br>
> ><br>
> ><br>
> > Anyway, KDiff3 (as any other KDE application) can be controlled with D-Bus. See the instructive article here:<br>
> ><br>
> > <a href="http://www.linuxjournal.com/article/10455" target="_blank" rel="noreferrer">http://www.linuxjournal.com/<wbr>article/10455</a><br>
> ><br>
> ><br>
> > You can easily found merge_choose_a_everywhere in the KDiff3 D-Bus tree under kdiff3/MainWindow_1/actions and set it.<br>
> ><br>
> ><br>
> > Options can be passed through additional arguments to the Windows CALL.<br>
> ><br>
> ><br>
> > Hope this helps.<br>
> ><br>
> ><br>
> > Best regards,<br>
> ><br>
> > Yuri<br>
> ><br>
> ><br>
> ><br>
> > > > ><br>
> > > ><br>
> > > > > 2. In the above example how do I set this option when calling KDiff3<br>
> > > ><br>
> > > > from command prompt.<br>
> > > ><br>
> > > > > For eg:<br>
> > > ><br>
> > > > > I am using a batch file and using the following command<br>
> > > ><br>
> > > > > call "C:\Program Files\kdiff3\kdiff3.exe" "C:\Users\xx\Documents\Rnd<br>
> > > ><br>
> > > > Learning\n1.txt" "C:\Users\xx\Documents\Rnd Learning\n2.txt"<br>
> > > ><br>
> > > > -o "C:\Users\xx\Documents\Rnd Learning\n3.txt"<br>
> > > ><br>
> > > > > How do I get the merge output in n3.txt which will have the merge<br>
> > > ><br>
> > > > product of n1.txt and n2.txt?<br>
> > > ><br>
> > > > > How do I set the option of "Choose A from everywhere" through the<br>
> > > ><br>
> > > > command prompt i.e What should I add in the above command line to achieve<br>
> > > ><br>
> > > > the "Choose A from everywhere" option.<br>
> > > ><br>
> > > > > Awaiting your reply.<br>
> > > ><br>
> > > > ><br>
> > > ><br>
> > > > > Regards,<br>
> > > ><br>
> > > > > Prashant<br>
> > > ><br>
> > > > ><br>
> > > ><br>
> > > > > On Tue, Aug 9, 2016 at 7:58 PM, Burkhard Lück<br>
> > > ><br>
</div></div><div class="HOEnZb"><div class="h5">> > > > wrote:<br>
> > > ><br>
> > > > >><br>
> > > ><br>
> > > > >> Am Dienstag, 9. August 2016, 18:21:02 CEST schrieb Prashant Pahurkar:<br>
> > > ><br>
> > > > >> > Hi,<br>
> > > ><br>
> > > > >> ><br>
> > > ><br>
> > > > >> > I have certain doubts and clarification required wrt using KDiff3<br>
> > > ><br>
> > > > tool as<br>
> > > ><br>
> > > > >> > follows:<br>
> > > ><br>
> > > > >> > 1. I want to merge 2 files and auto resolve the conflict by adding<br>
> > > ><br>
> > > > first<br>
> > > ><br>
> > > > >> > lines from File A and then appending it with Lines from B. Is it<br>
> > > ><br>
> > > > possible<br>
> > > ><br>
> > > > >> > without manual intervention.<br>
> > > ><br>
> > > > >> > 2. Also Can i achieve the same using command prompt.<br>
> > > ><br>
> > > > >> > For ex: I am using a batch file and using the following command<br>
> > > ><br>
> > > > >> > call "C:\Program Files\kdiff3\kdiff3.exe" --auto<br>
> > > ><br>
> > > > >> > "C:\Users\296170\Documents\Rnd Learning\n1.txt"<br>
> > > ><br>
> > > > >> > "C:\Users\296170\Documents\Rnd Learning\n2.txt" -o<br>
> > > ><br>
> > > > >> > "C:\Users\296170\Documents\Rnd Learning\n3.txt"<br>
> > > ><br>
> > > > >> ><br>
> > > ><br>
> > > > >> > This will display the page where it will ask me to select from File A<br>
> > > ><br>
> > > > or B<br>
> > > ><br>
> > > > >> > to resolve the conflict. But through command prompt I would like to<br>
> > > ><br>
> > > > get the<br>
> > > ><br>
> > > > >> > merge output in n3.txt which will have the merge product of n1.txt and<br>
> > > ><br>
> > > > >> > n2.txt.<br>
> > > ><br>
> > > > >> > Please let me know if this is possible and what would be the command<br>
> > > ><br>
> > > > to<br>
> > > ><br>
> > > > >> > achieve this?<br>
> > > ><br>
> > > > >> ><br>
> > > ><br>
> > > > >> Please read <a href="https://docs.kde.org/trunk4/en/extragear-utils/kdiff3/" target="_blank" rel="noreferrer">https://docs.kde.org/trunk4/<wbr>en/extragear-utils/kdiff3/</a><br>
> > > ><br>
> > > > >> documentation.html#commandline<br>
> > > ><br>
> > > > >><br>
> > > ><br>
> > > > >> --<br>
> > > ><br>
> > > > >> Burkhard Lück<br>
> > > ><br>
> > > > >><br>
> > > ><br>
> > > > ><br>
<br>
<br>
</div></div></blockquote></div><div class="gmail_extra"><br></div></div>