[Solved] Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-09 Thread Susmita/Rajib
As mentioned in the following email:

To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing two
text files where Word Wrap is possible?
From: "Susmita/Rajib" 
Date: Sat, 8 Apr 2023 23:12:57 +0530
Message-id: <[]
CAEG4cZWR7jFCnPXqdq29qSq=okxpuaduzzum4uufk48tp_p...@mail.gmail.com>

[   ...   ]

Thank you, Mr. Davidson, Mr. Sascha Steinbiss, Mr. Jeff Kaufman, Mr.
l0f4r0 and my senior members and leaders of the Debian Universe who
interacted with me in this thread to help me fulfil my needs with
diff. I apologise that I didn't thank you by name.

Thank you all once again.

Best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-09 Thread Greg Wooledge
On Sun, Apr 09, 2023 at 03:13:22PM +0530, Susmita/Rajib wrote:
> I apologise I didn't get you. Do you not want me to quote the following 
> portion?



Perhaps you don't understand what your own messages look like.  Therefore,
the best advice I can give you is to look at them through an external
lens.

Here's a message from this thread which is written in a "normal" way,
conforming to the standards and expectations of Internet email:

https://lists.debian.org/debian-user/2023/04/msg00339.html

And here's one of yours:

https://lists.debian.org/debian-user/2023/04/msg00350.html

Compare and contrast.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-09 Thread Brad Rogers
On Sun, 9 Apr 2023 15:13:22 +0530
"Susmita/Rajib"  wrote:

Hello Susmita/Rajib,

>Sometimes I have difficulties understanding some emails.

That's understandable if, as I'm assuming, English is not your first
language.

>Could you please elaborate a little further please?

Use a quote style like everybody else does.  Do not add all the
references in the body. Doing so serves no purpose.

>My need is fulfilled. So I requested Mr. Davidson's permission to
>close this thread.

You don't need permission, you just thank those that assisted you for
their help, and move on.  You may, also add something like [SOLVED] to
the subject line in that message to make it clear to others that your
needs have been satisfied.

-- 
 Regards  _   "Valid sig separator is {dash}{dash}{space}"
 / )  "The blindingly obvious is never immediately apparent"
/ _)rad   "Is it only me that has a working delete key?"
But they didn't tell him the first two didn't count
Tin Soldiers - Stiff Little Fingers


pgp_bfGvnJ_Sx.pgp
Description: OpenPGP digital signature


Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-09 Thread davidson

On Sun, 9 Apr 2023 Susmita/Rajib wrote:
[trim]

I just received an email from Mr. Sascha Steinbiss, the maintainer
for icdiff, and tried implementing his advice on columns. I have
received messages from Mr. Jeff Kaufman, the original creator.
Copies of my emails have been sent you too.

My system's screen accommodated upto 170 columns.

icdiff --cols=170 file1.txt file2.txt | less -R


I am glad to learn that the column width switch solved your problem.


So this should rest the case, with your permission.


You are the judge that decides the matter.

Good luck completing your work.

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-09 Thread Susmita/Rajib
To: Debian Users ML 
Subject: Re: Which Diff tool could I use for visually comparing two
text files where Word Wrap is possible?
From: Brad Rogers 
Date: Sun, 9 Apr 2023 08:46:18 +0100
Message-id: <[] 20230409084618.1807a...@earth.stargate.org.uk>

Mr. Brad Rogers said:
[   ...   ]
Please be are that people here are volunteering their time, and time is
a precious commodity.  Would you therefore, make life easy for them by
using a convention quoting style in your messages to the list.

Persist with the style you currently employ and you will find that
people's desire to help wanes.

In short;  Help us to help you.
[   ...   ]

I apologise I didn't get you. Do you not want me to quote the following portion?

-
To: Debian Users ML 
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: Brad Rogers 
Date: Sun, 9 Apr 2023 08:46:18 +0100
Message-id: <[] 20230409084618.1807a...@earth.stargate.org.uk>
Reply-to: Debian Users ML 
In-reply-to: <[]
caeg4czu12ltmr8k3tuzhyujrkp1vzzcaxrhcjywhjttwec3...@mail.gmail.com>
References:

<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] CAEG4cZUHrTGhpv2XswpW0XhFwO+udKk-bsFJWT1UDr6iRO=z...@mail.gmail.com>
<[] caeg4czvut9br_7acyuk-pyljkatxlxgvxoszupugpiugh6k...@mail.gmail.com>
<[] CAEG4cZWR7jFCnPXqdq29qSq=okxpuaduzzum4uufk48tp_p...@mail.gmail.com>

<[] caeg4czu12ltmr8k3tuzhyujrkp1vzzcaxrhcjywhjttwec3...@mail.gmail.com>
-

Sometimes I have difficulties understanding some emails.

Could you please elaborate a little further please?

My need is fulfilled. So I requested Mr. Davidson's permission to
close this thread.

Best,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-09 Thread Brad Rogers
Please be are that people here are volunteering their time, and time is
a precious commodity.  Would you therefore, make life easy for them by
using a convention quoting style in your messages to the list.

Persist with the style you currently employ and you will find that
people's desire to help wanes.

In short;  Help us to help you.

-- 
 Regards  _   "Valid sig separator is {dash}{dash}{space}"
 / )  "The blindingly obvious is never immediately apparent"
/ _)rad   "Is it only me that has a working delete key?"
Early morning when I wake up, I look like Kiss but without the make up
Strong - Robbie Williams


pgpuW9De9JdxP.pgp
Description: OpenPGP digital signature


Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-08 Thread Susmita/Rajib
In further response to two emails received from Mr. Davidson.

To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Sat, 8 Apr 2023 13:27:54 + (UTC)
Message-id: <[] alpine.deb.2.21.2304081043580.22...@azone.org>
In-reply-to: <[]
caeg4czvut9br_7acyuk-pyljkatxlxgvxoszupugpiugh6k...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] CAEG4cZUHrTGhpv2XswpW0XhFwO+udKk-bsFJWT1UDr6iRO=z...@mail.gmail.com>
<[] caeg4czvut9br_7acyuk-pyljkatxlxgvxoszupugpiugh6k...@mail.gmail.com>

and

To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Sat, 8 Apr 2023 14:02:15 + (UTC)
Message-id: <[] alpine.deb.2.21.2304081359510.22...@azone.org>
In-reply-to: <[] alpine.deb.2.21.2304081043580.22...@azone.org>
References:

<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] CAEG4cZUHrTGhpv2XswpW0XhFwO+udKk-bsFJWT1UDr6iRO=z...@mail.gmail.com>
<[] caeg4czvut9br_7acyuk-pyljkatxlxgvxoszupugpiugh6k...@mail.gmail.com>
<[] alpine.deb.2.21.2304081043580.22...@azone.org>

[   ...   ]

Dear Mr. Davidson,

I just received an email from Mr. Sascha Steinbiss, the
maintainer for icdiff,  and tried implementing his advice on
columns. I have received messages from Mr. Jeff Kaufman, the original creator.
Copies of my emails have been sent you too.

My system's screen accommodated upto 170 columns.

icdiff --cols=170 file1.txt file2.txt | less -R

So this should rest the case, with your permission.

Best wishes,
Rajib
Etc.



Re: paragraph conversion (was Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?)

2023-04-08 Thread Susmita/Rajib
Dear Mr. Davidson,

I just received an email from  and tried implementing his advice on
columns. I have received messages from Mr.  Sascha Steinbiss, the
maintainer for icdiff, and Mr. Jeff Kaufman, the original creator.
Copies of my emails have been sent you too.

My system's screen accommodated upto 170 columns.

icdiff --cols=170 file1.txt file2.txt | less -R

So this should rest the case, with your permission.

Best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-08 Thread Andrew M.A. Cater
On Sat, Apr 08, 2023 at 11:12:57PM +0530, Susmita/Rajib wrote:
> 
> No, easier. I use Libre Office buttons for Left, Right, Centre or
> Justified alignment. No keystrokes. Only one Enter Key after a full
> stop, no space bar. But if Heading, then no full stop, no space bar,
> but only paragraph. No other use of Paragraph "Enter" key. As
> simplified as possible. In libreoffice I use Heading Levels to create
> Chapters, Sections, Sub-sections, et al. Very simple style, or no
> style at all.
> 
> So the text file is all Left aligned in every paragraph.
> 
> Just like I write my emails in plain text without Line Breaks. Google
> introduces the line breaks in every line. I don't. My text is
> free-flowing, no Line Breaks unless one paragraph or Title/Heading. As
> simple as can be.
>

Don't do that please. The mailing list Code of Conduct and other suggestions
within Debian suggest creating lines no longer than 72 characters. Line breaks
make things significantly easier to read as does breaking up large blocks
of text. 

Likewise the references above from Gmail mails. Please don't - it means
that each of us has 13 lines of incomprehensibility repeated whenever
you reply to any mail. Jon Postel's suggestion to be strict in what
you put out and generous in what you accept is being stretched to the
limit here.

If all you are doing is comparing LibreOffice documents, use LibreOffice
document tracking to compare documents. When you deal with a (human) editor
who doesn't use LibreOffice, export it as a basic Word document and
reimport.

If that doesn't work then exchange basic text and use TeX to format the 
output appropriately. Messing around with complex word-processing 
documents and expecting to use diff to do this is probably the wrong way
round. You might *even* be better exchanging Markdown files and using git
to version track ...

All the very best, as ever,

Andy Cater



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-08 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Sat, 8 Apr 2023 13:27:54 + (UTC)
Message-id: <[] alpine.deb.2.21.2304081043580.22...@azone.org>
In-reply-to: <[]
caeg4czvut9br_7acyuk-pyljkatxlxgvxoszupugpiugh6k...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] CAEG4cZUHrTGhpv2XswpW0XhFwO+udKk-bsFJWT1UDr6iRO=z...@mail.gmail.com>
<[] caeg4czvut9br_7acyuk-pyljkatxlxgvxoszupugpiugh6k...@mail.gmail.com>

and


To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Sat, 8 Apr 2023 14:02:15 + (UTC)
Message-id: <[] alpine.deb.2.21.2304081359510.22...@azone.org>
In-reply-to: <[] alpine.deb.2.21.2304081043580.22...@azone.org>
References:

<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] CAEG4cZUHrTGhpv2XswpW0XhFwO+udKk-bsFJWT1UDr6iRO=z...@mail.gmail.com>
<[] caeg4czvut9br_7acyuk-pyljkatxlxgvxoszupugpiugh6k...@mail.gmail.com>
<[] alpine.deb.2.21.2304081043580.22...@azone.org>

[   ...   ]
I am not familiar with Bin, but I imagine it is a hex viewer/editor.
[   ...   ]

Apologies. I meant binary code. Yes, in a Hex editor. wxhexeditor. I
usually use okteta in Knoppix.

[   ...   ]
Are saying that this entire sequence of three keystrokes is how you
type a paragraph break? So that your paragraphs look like this (but
wider)?
[   ...   ]

No, easier. I use Libre Office buttons for Left, Right, Centre or
Justified alignment. No keystrokes. Only one Enter Key after a full
stop, no space bar. But if Heading, then no full stop, no space bar,
but only paragraph. No other use of Paragraph "Enter" key. As
simplified as possible. In libreoffice I use Heading Levels to create
Chapters, Sections, Sub-sections, et al. Very simple style, or no
style at all.

So the text file is all Left aligned in every paragraph.

Just like I write my emails in plain text without Line Breaks. Google
introduces the line breaks in every line. I don't. My text is
free-flowing, no Line Breaks unless one paragraph or Title/Heading. As
simple as can be.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-08 Thread davidson

On Sat, 8 Apr 2023 davidson wrote:

On Fri, 7 Apr 2023 Susmita/Rajib wrote:
Hanging Style___

Also called the Epstein
  style, this one is
  probably not the one
  you are using in
  your document.

At least, not unless
  you are writing a
  glossary, or some
  kind of dictionary.



Hanging style does not include a blank line separator like the example
above does.

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-08 Thread davidson

On Fri, 7 Apr 2023 Susmita/Rajib wrote:
[trimmed: email headers included in message body]

Ok, I shall abide by your greater wisdom.


I deny this accusation.


I would have been better guided by a simple instruction to inform
you about the binary for the line breaks, paragraph marks, et
al. With a little introduction. So here goes:


While forensic details of your plain text document's file format is
interesting and not unhelpful, I apologise for being unclear when I
wrote:

On Thu, 6 Apr 2023 davidson (DAV):
DAV> What indicates a "paragraph break" in a given style depends on
DAV> the form, not the content, of the material to be processed.

By the term "form", above, I meant the style of the document not the
file format of its digital representation.

I should have said "document" instead of "material".

DAV> It is the style of paragraph that you must reveal here

Paragraph style is apparent to the casual observer.

Hopefully you will find that one of the examples below match your
document style. If not, I trust you can present us with a couple of
short example paragraphs populated with lorem ipsum which do.


Libre Office file is used as the Editor to write the article.


You compose your original document in Libre Office. Understood.


It was used to convert the main file in plain text file for the
purpose of diff.


You then export it to plain text file format before processing it with
tools designed for plain text. Sensible.


Beginning of the article in Bin:


I am not familiar with Bin, but I imagine it is a hex viewer/editor.


[Bin code]
EF BB BF 0A 0A 0A 4A 75 73 74 20 41 20 53 74 61 74 69 6F 6E 20

  ^^ ^^ ^^

The first three bytes there are a unicode BOM, or Byte Order Mark,
encoded in utf-8. It is harmless. Libre Office probably put it
there. It conveniently suggests that we are looking at unicode
characters encoded in utf-8.

Next follow three newlines (normally displayed as three blank lines at
the top of the document).


[/Bin code]
Translates to text in a text editor:
"Some unreadable characters


The BOM, presumably...


and Just A Station"


...with 'J' flush to the lefthand margin. That phrase being followed
by a space (The Final Frontier).


Paragraph break with the key "Enter" is 0A.


I am aware of no paragraph style that does not include a newline. This
does not help narrow things down, unless one construes the next two
items to complete the characterisation of a paragraph break.


Line Break with the combo keys "Shift Enter" is also 0A.
Space with Space Bar is 20.


Are saying that this entire sequence of three keystrokes is how you
type a paragraph break? So that your paragraphs look like this (but
wider)?

Mystery House Style_

 This is one paragraph,
written within twenty-
four columns.

 Here is another one,
written within those
same twenty-four col-
umns.


If so, please confirm. Otherwise, here are some alternatives:

Plain Style_

   These paragraphs are
set in "plain" style.
As you can see, its
first line is indented.
   In plain style,
there is not usually a
blank line dividing
each paragraph.
   The precise depth of
the indentation is not
important. Its presence
is what matters.


Flush Style_

Do all O'Reilly books
exhibit this style? Are
they trying to instill
hygienic practices sub-
liminally?

In this style, a blank
line indicates the end
of one paragraph and
the beginning of, if
not a better paragraph,
at least a new one.


Hanging Style___

Also called the Epstein
   style, this one is
   probably not the one
   you are using in
   your document.

At least, not unless
   you are writing a
   glossary, or some
   kind of dictionary.


I will be surprised if one of these styles is not the one you are
using.

--
It is close to an axiom for me that when rich people expend
considerable sums of other people's money to persuade me something is
good for us, to disbelieve them. -- George Galloway



Re: paragraph conversion (was Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?)

2023-04-08 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: paragraph conversion (was Re: Which Diff tool could I use
for visually comparing two text files where Word Wrap is possible?)
From: davidson 
Date: Sat, 8 Apr 2023 05:47:45 + (UTC)
Message-id: <[] alpine.deb.2.21.2304080512420.28...@azone.org>
In-reply-to: <[] alpine.deb.2.21.2304051324580.20...@azone.org>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] alpine.deb.2.21.2304051324580.20...@azone.org>

[   ...   ]
Since you have not exhibited here any of the text you are working with, I
can only play the role of speculative optimist.
[   ...   ]

But did you not notice my earlier post
https://lists.debian.org/debian-user/2023/04/msg00254.html wherein I
posted the directed information?

I shall not begin experimenting unless we both are on the same page.
But I really thank you. You know why? The reason:
https://forums.debian.net/viewtopic.php?t=138583
I tried, but was repulsed.
But please ignore the post.

Best wishes,
Rajib
Etc.



paragraph conversion (was Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?)

2023-04-07 Thread davidson

On Wed, 5 Apr 2023 davidson wrote:

On Wed, 5 Apr 2023 Susmita/Rajib wrote:

On 04/04/2023, davidson  wrote:

[trim]


Attached (unless the listserv software has nuked it) is a sed script
"flow" (with verbose comments) which might serve your needs. (Since
you have not exhibited here any of the text you are working with, I
can only play the role of speculative optimist.)

For trial purposes make a new, empty directory. Here we'll pretend
that directory is called "testing". Put "flow" in that directory. Then
do

$ cd testing # Make testing your current directory
$ chmod u+x flow # Make flow executable
$ PATH="$PATH:$PWD" # Now "flow" means something, for this session
$ icdiff-flow () { icdiff <( flow <"$1" ) <( flow <"$2" ) ; }

and then you should be able to test it out in that same shell session:

$ flow document # see if flow works as intended with a single document
$ icdiff-flow document1 document2 # see if it works well with icdiff


Attached is a more adequate version of "flow", for converting plain
text paragraphs, in flush or plain style*, to single lines. Unlike the
previous version, version 2.0 does not fumble on the last line of the
document and fail to print material before quitting.

* A "plain" paragraph begins with its first line indented, whereas a
  "flush" paragraph is distinguished from its neighbors by blank
  newlines.

--
Sometimes it pays to have squirrels in your head running around making
you question everything. -- Clive Robinson#!/usr/bin/env -S sed -f
# Flow text. (Remove intra-paragraph newlines.)
# Version 2.0

# First line of document initialises storage.
1 {
h   # 1. A copy goes to storage.
d   # 2. The original (still on the workbench) is discarded and a new 
cycle begins.
}
# When a line starts with non-whitespace character,
# We assume it belongs to a paragraph accumulating in storage.
/^[^[:blank:]]/ { 
H   # 1. A copy goes to storage.
$ {   # In case this line terminates the document...
g # ...Get everything out of storage.
s/\(.\)\n\(.\)/\1 \2/g# ...Replace every interstitial newline with 
a space.
q # ...Print and quit NOW.
}
d   # 2. Toss out the original (the one still on the workbench) and 
begin new cycle
}
# When a line does not start with non-whitespace character (ie, it is empty or 
begins with whitespace),
# We assume it begins a new paragraph.
# We further assume that whatever is in storage we may now format (and print) 
as if it were a paragraph.
/^\([[:blank:]]\|$\)/ {
x # 1. Swap: A copy goes to storage, and what was 
in storage lands on the workbench.
s/\(.\)\n\(.\)/\1 \2/g# 2. Format: Replace every interstitial newline 
with a space. (Then print it.)
$ {   # In case this line terminates the document...
p # ...The stuff we just formatted gets printed,
g # ...and then retrieve the line we just stored, 
and print it too before we quit. 
}
}


Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-06 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Thu, 6 Apr 2023 18:21:29 + (UTC)
Message-id: <[] alpine.deb.2.21.2304061821250.7...@azone.org>
In-reply-to: <[]
CAEG4cZUHrTGhpv2XswpW0XhFwO+udKk-bsFJWT1UDr6iRO=z...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] CAEG4cZUHrTGhpv2XswpW0XhFwO+udKk-bsFJWT1UDr6iRO=z...@mail.gmail.com>

and

To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: david...@freevolt.org
Date: Thu, 6 Apr 2023 18:29:56 + (UTC)
Message-id: <[] alpine.deb.2.21.2304061829500.7...@azone.org>
In-reply-to: <[] alpine.deb.2.21.2304061821250.7...@azone.org>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] CAEG4cZUHrTGhpv2XswpW0XhFwO+udKk-bsFJWT1UDr6iRO=z...@mail.gmail.com>
<[] alpine.deb.2.21.2304061821250.7...@azone.org>

[   ...   ]

Ok, I shall abide by your greater wisdom.

I would have been better guided by a simple instruction to inform you
about the binary for the line breaks, paragraph marks, et al. With a
little introduction. So here goes:

Libre Office file is used as the Editor to write the article. It was
used to convert the main file in plain text file for the purpose of
diff.
Beginning of the article in Bin:
[Bin code]
EF BB BF 0A 0A 0A 4A 75 73 74 20 41 20 53 74 61 74 69 6F 6E 20
[/Bin code]
Translates to text in a text editor:
"Some unreadable characters and Just A Station"

Paragraph break with the key "Enter" is 0A.
Line Break with the combo keys "Shift Enter" is also 0A.
Space with Space Bar is 20.

Best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-06 Thread davidson

On Thu, 6 Apr 2023 davidson wrote:


What indicates a "paragraph break" in a given style depends on the
form, not the content, of the material to be processed.


Replace

 "...in a given style"

with

 "...in a given document"

--
Sometimes it pays to have squirrels in your head running around making
you question everything.  -- Clive Robinson



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-06 Thread davidson

On Thu, 6 Apr 2023 Susmita/Rajib wrote:
[trimmed: email headers included in message body]

[   ...   ]
Dear Mr. Davidson, I think that we better drop this thread for the
time being.


We are each of us the masters of our respective time and attention,
and thank ${DEITY[@]} for that.

I look forward to your return.


I have written to Sascha Steinbiss, the Maintainer, icdiff in debian
repo, with the links to the specific emails of this thread.


As I have already said, I believe that will prove to be an
unproductive line of attack on the text processing problem which
confronts you.


I am sure, the brilliant programmer that he is, he would heed to our
indications and would come up with something apt in the near future.


I suspect that you underestimate your own potential learn how to use
the tools at your disposal. At least as regards the elementary (and
potentially instructive) text processing problem you have presented
here.


I am more concerned about your wasting so much of your precious
energy into the matter


This form of politeness is lost on me, where one pretends that
expedience for oneself is expedience for another.

I do what I please. Rely on it.


that has to be solved from within the program itself,


It does not. Transforming the input is a trivial operation.


programmatically by tweaking the source code, rather than using
scripts.


I refer you back to previous expository comments about tools, and the
productivity of compositionality.

[trimmed: more gracious externalisation of responsibility]

I apologise that I could not explain more on the text as they form a
part of my book and also my research papers


What indicates a "paragraph break" in a given style depends on the
form, not the content, of the material to be processed.

It is the style of paragraph that you must reveal here if iterative
guesswork has become tiresome, not the content of your researches.


which requires the services of an editor.


You wish to display, in a form enabling your review, the differences
between your own copy of a text and an editor's revision.

This requires the services of your computer. Which is why you have
sought help here, appropriately enough.


Since I am an independent researcher, I post my articles in
vixra.org.


Good luck with your researches.

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-06 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Wed, 5 Apr 2023 16:25:06 + (UTC)
Message-id: <[] alpine.deb.2.21.2304051620250.20...@azone.org>
In-reply-to: <[] alpine.deb.2.21.2304051324580.20...@azone.org>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] caeg4czvocyzux5gjxbdv5uyt1mxhmfdxglz_asbppmkjch2...@mail.gmail.com>
<[] CAEG4cZX0DogxF=8-rjc_TzqgL8=evmorep8bq3zv8wycnt2...@mail.gmail.com>
<[] alpine.deb.2.21.2304051324580.20...@azone.org>

[   ...   ]

Dear Mr. Davidson, I think that we better drop this thread for the
time being. I have written to Sascha Steinbiss, the Maintainer, icdiff
in debian repo, with the links to the specific emails of this thread.

I am sure, the brilliant programmer that he is, he would heed to our
indications and would come up with something apt in the near future.

I am more concerned about your wasting so much of your precious energy
into the matter that has to be solved from within the program itself,
programmatically by tweaking the source code, rather than using
scripts.

Please preserve your energy and use it to a better challenge that can
be solved. You have done enough already. Given me a clearer
perspective. Presently, I shall adjust myself to live with the current
limitations of icdiff. What I have is already sufficient for me to
proceed ahead.

I apologise that I could not explain more on the text as they form a
part of my book and also  my research papers which requires the
services of an editor. Since I am an independent researcher, I post my
articles in vixra.org.

Best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-05 Thread davidson

On Wed, 5 Apr 2023 davidson wrote:

Attached (unless the listserv software has nuked it) is a sed script
"flow" (with verbose comments) which might serve your needs. (Since
you have not exhibited here any of the text you are working with, I
can only play the role of speculative optimist.)

For trial purposes make a new, empty directory. Here we'll pretend
that directory is called "testing". Put "flow" in that directory. Then
do

$ cd testing # Make testing your current directory
$ chmod u+x flow # Make flow executable
$ PATH="$PATH:$PWD" # Now "flow" means something, for this session
$ icdiff-flow () { icdiff <( flow <"$1" ) <( flow <"$2" ) ; }


The shell function can be made a little simpler:

 $ icdiff-flow () { icdiff <( flow "$1" ) <( flow "$2" ) ; }

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-05 Thread davidson

On Wed, 5 Apr 2023 davidson wrote:

Attached (unless the listserv software has nuked it) is a sed script
"flow" (with verbose comments) which might serve your needs. (Since
you have not exhibited here any of the text you are working with, I
can only play the role of speculative optimist.)


Tested with

 $ sed --version | head -1
 sed (GNU sed) 4.7

 $ dpkg-query -l sed # check that it is installed
 Desired=Unknown/Install/Remove/Purge/Hold
 | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
 |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
 ||/ Name   Version  Architecture Description
 
+++-==---=
 ii  sed4.7-1amd64GNU stream editor for 
filtering/transforming text

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-05 Thread davidson

On Wed, 5 Apr 2023 Susmita/Rajib wrote:

On 04/04/2023, davidson  wrote:

[trimmed email headers]
[trimmed preliminary negotiation of what would constitute a solution]


That is, you'd like to be shown as many characters on one screen as
possible, without a lot of wastefully empty margins.

(I expect I have overstated your intent here. Do correct me.)


There can absolutely be no need for correcting you. You have extracted
what I really meant from my poor choice of words. Yes, more "column
width" would reflect in "longer lines" without wasting empty margins.
PERFECT. Thank you indeed.


It looks to me like icdiff tries to remain faithful to the source
comparands, to the files you request it to compare.


By "faithful", I mean two things:

 1. icdiff will *wrap* lines so that all characters (relevant to the
diff context) make it onto the screen in whichever half of the
screen they belong. This entails the insertion of line breaks that
are not in the source files. This is nonetheless faithful because
if icdiff did not do this, then it would be unable to display all
characters in the sources (relevant to the diff context).

 2. icdiff will not *remove* line breaks that are present in the
source files. This would not be faithful. Line breaks are
characters too.

Its job is to accurately display the distinctions between two files
for you. If it *removed* certain characters to make things prettier
for you, it would sabotage its ability to accomplish its task in full
generality.

In other words, it would make itself less useful.

Your wish to fill the margins with text requires removal of line
breaks. Because icdiff is faithful to its input, you must arrange to
remove those line breaks from the input you provide to icdiff. It will
not do it for you.

[trimmed definition of naive flow-text function]

So the final steps should look like this:
Define a unique function:
icdiff-flowed () { icdiff <( tr '\n' ' ' <"$1" ) <( tr '\n' ' ' <"$2" ) ; }

Then use that function:
icdiff-flowed file1 file2 | less -R

Perfect.


Well, not quite, as you discovered. We removed ALL the newlines, so
icdiff had to process a pair of lines many thousands of characters
long.


But I received an error when the lxterminal screen was the default
size:
RecursionError: maximum recursion depth exceeded while calling a
Python object


I don't think icdiff was designed for lines that long.


When the screen was maximised, I received an output, but all
line-breaks, paragraph breaks,

   

If you want to preserve paragraph breaks, you need to arrange for
that. If we remove all newlines, we remove all paragraph breaks.

So you want to remove *some* newlines, but preserve others.


distinctions, separate colours, et al, were made into two colours,
one for the new file and one for the old.


Yeah, it looked like garbage.


May be the translation of '\n' into blank space ' ' is creating the
problem. Removing all formatting.


We literally removed all the newlines. Replaced them with
spaces. That's what "tr" did, and that's *all* it did. The formatting
that you percieve to be removed consisted of nothing but newlines.


Could the creators/maintainers be contacted to amend the program to
adjust column width? Is there a way to set icdiff's column width?


If you read the man page, you will see that there is. But I expect
that you will be disappointed to discover that setting the column
width does not do what you want.

I expect, in fact, that you will find that icdiff *by default* already
sets its width optimally, for whatever dimensions your terminal has at
the time you invoke it.

What you probably want is flowed text.

If you remove paragraph-internal newlines (and *only* those newlines)
from the input you provide to icdiff, then icdiff will wrap the
paragraphs naturally (ie, insert newlines to keep the paragraphs
displayed within the available columns), as needed.

And since they are *your* paragraphs, *you* are the one who knows how
to remove "paragraph-internal" newlines. I do not recommend trying to
harrass the author of a decent general purpose tool into flowing them
for you.

Attached (unless the listserv software has nuked it) is a sed script
"flow" (with verbose comments) which might serve your needs. (Since
you have not exhibited here any of the text you are working with, I
can only play the role of speculative optimist.)

For trial purposes make a new, empty directory. Here we'll pretend
that directory is called "testing". Put "flow" in that directory. Then
do

 $ cd testing # Make testing your current directory
 $ chmod u+x flow # Make flow executable
 $ PATH="$PATH:$PWD" # Now "flow" means something, for this session
 $ icdiff-flow () { icdiff <( flow <"$1" ) <( flow <"$2" ) ; }

and then you should be able to test i

Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-05 Thread Susmita/Rajib
On 04/04/2023, davidson  wrote:
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Tue, 4 Apr 2023 11:06:47 + (UTC)
Message-id: <[] alpine.deb.2.21.2304041106390.12...@azone.org>
In-reply-to: <[]
caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>


[   ...   ]

> No mistakes means no learning. Learning how to make mistakes, to dare
> the facts to expose one's false beliefs, is a great art.

[   ...   ]

> Would it be possible to increase the column length for the either of
> the two files being compared,

I apologise for my yet another idiotic choice of word. It should have
been "width", not "length".

[   ...   ]
> I take this to mean that you would like to increase the length of
> lines displayed...
[   ...   ]
> ...in order to maximise the use of screen real estate.
>
> That is, you'd like to be shown as many characters on one screen as
> possible, without a lot of wastefully empty margins.
>
> (I expect I have overstated your intent here. Do correct me.)

There can absolutely be no need for correcting you. You have extracted
what I really meant from my poor choice of words. Yes, more "column
width" would reflect in "longer lines" without wasting empty margins.
PERFECT. Thank you indeed.


> It looks to me like icdiff tries to remain faithful to the source
> comparands, to the files you request it to compare.
>
> More concretely: Let's say the source files have newlines at a
> position no greater than column 55 (say). This means a side-by-side
> comparison will require about 113 columns.
>
> Since you have a giant display that can accomodate far more than that,
> icdiff displays sizeable righthand margins on each half of a maximised
> terminal window.
>
> So you would like icdiff to "flow" the text when it displays each
> source on its half of the terminal. You would like icdiff to replace
> newlines with spaces, and then wrap them (ie, inserting new newlines)
> as appropriate to fill up the right margins on each half.
>
> icdiff will not do that. icdiff is faithful to its sources. I have
> determined this by trying it out a little myself, and by examining the
> command line options documented in its manual page ("man icdiff").
>
> You could give it different sources:
>
>  $ icdiff <( tr '\n' ' ' 
> You can define a function to do the same thing, to save some typing at
> future invocations,
>
>  $ icdiff-flowed () { <( tr '\n' ' ' 
> and then use it like so
>
>  $ icdiff-flowed file1 file2 | less -R
>
> I imagine this is not quite what you want. But this seems like a good
> place to pause, to give you an opportunity to correct me, or to
> elaborate on the requirements.

Perfectly set to go.

> If that is not possible
>
>
> I expect it is, but I may not yet fully understand what you are
> looking for.

Yes, you really did step into my shoes. Thank you indeed.

So the final steps should look like this:
Define a unique function:
icdiff-flowed () { icdiff <( tr '\n' ' ' <"$1" ) <( tr '\n' ' ' <"$2" ) ; }

Then use that function:
icdiff-flowed file1 file2 | less -R

Perfect.

But I received an error when the lxterminal screen was the default size:
RecursionError: maximum recursion depth exceeded while calling a Python object

When the screen was maximised, I received an output, but all
line-breaks, paragraph breaks, distinctions, separate colours, et al,
were made into two colours, one for the new file and one for the old.

May be the translation of '\n' into blank space ' ' is creating the
problem. Removing all formatting. Could the creators/maintainers be
contacted to amend the program to adjust column width? Is there a way
to set icdiff's column width?

Could you please change the html files you had used for
experimentation into text files and then run the experiment again? To
see if our objectives could be fulfilled?

Thanks once more.

Best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-04 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: david...@freevolt.org
Date: Tue, 4 Apr 2023 11:39:59 + (UTC)
Message-id: <[] alpine.deb.2.21.2304041139540.12...@azone.org>
In-reply-to: <[] alpine.deb.2.21.2304041109440.12...@azone.org>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
<[] CAEG4cZXvzBMjbsRRih6Ku1wSJN0oWP_=y_tlfbuoobgplio...@mail.gmail.com>
<[] caeg4czubt-mfzn4rn1odmyema0tmufauwzch1s3pbc+z7w2...@mail.gmail.com>
<[] alpine.deb.2.21.2304041106390.12...@azone.org> <[]
alpine.deb.2.21.2304041109440.12...@azone.org>

On Tue, 4 Apr 2023 david...@freevolt.org wrote:
[   ...   ]

I will try to comprehend, then try and get back. But I had to admire
you for the efforts you have put in to solve my issue.

My files are around 40k, so shouldn't pose much of a problem,
$wc -m book1.txt
41466 book1.txt

$wc -m book2.txt
32798 book2.txt

Rest feedback, after I have been able to implement your ideas, will follow.

Best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-04 Thread davidson

On Tue, 4 Apr 2023 david...@freevolt.org wrote:

On Tue, 4 Apr 2023 davidson wrote:
[trim]

icdiff will not do that. icdiff is faithful to its sources. I have
determined this by trying it out a little myself, and by examining the
command line options documented in its manual page ("man icdiff").

You could give it different sources:

$ icdiff <( tr '\n' ' ' 

Typos ahead:


True.


$ icdiff-flowed () { <( tr '\n' ' ' 

Correction:

$ icdiff-flowed () { <( tr '\n' ' ' <"$1" ) <( tr '\n' ' ' <"$2" ) ; }


Yet another correction:

 $ icdiff-flowed () { icdiff <( tr '\n' ' ' <"$1" ) <( tr '\n' ' ' <"$2" ) ; }


and then use it like so

$ icdiff-flowed file1 file2 | less -R


And a caveat:

I recall that the files you are comparing are quite large.

The above worked on okay on about 1000 line files with about 50,000
characters.

But I would not use it with significantly larger files.

  $ wc -l vinge_1981_true_names.*html # how many lines
  3688 vinge_1981_true_names.html
  4152 vinge_1981_true_names.parafix.html

  $ du -h vinge_1981_true_names.*html
  176Kvinge_1981_true_names.html
  176Kvinge_1981_true_names.parafix.html

I think those were too big:

  $ icdiff-flowed vinge_1981_true_names.html vinge_1981_true_names.parafix.html 
>vinge_1981_true_names.icdiff_flowed
 Traceback (most recent call last):
  File "/usr/bin/icdiff", line 11, in 
load_entry_point('icdiff==1.9.5', 'console_scripts', 'icdiff')()
  File "/usr/lib/python3/dist-packages/icdiff.py", line 598, in start
diff(options, *args)
  File "/usr/lib/python3/dist-packages/icdiff.py", line 635, in diff
diff_files(options, a, b)
  File "/usr/lib/python3/dist-packages/icdiff.py", line 764, in diff_files
for line in cd.make_table(
  File "/usr/lib/python3/dist-packages/icdiff.py", line 350, in make_table
for left, right in self._generate_table(fromdesc, todesc, diffs):
  File "/usr/lib/python3/dist-packages/icdiff.py", line 360, in _generate_table
for i, line in enumerate(diffs):
  File "/usr/lib/python3/dist-packages/icdiff.py", line 255, in _collect_lines
for fromdata, todata, flag in diffs:
  File "/usr/lib/python3/dist-packages/icdiff.py", line 232, in _line_wrapper
self._split_line(fromlist, fromline, fromtext)
  File "/usr/lib/python3/dist-packages/icdiff.py", line 217, in _split_line
self._split_line(data_list, '>', line2)
  File "/usr/lib/python3/dist-packages/icdiff.py", line 217, in _split_line
self._split_line(data_list, '>', line2)
  File "/usr/lib/python3/dist-packages/icdiff.py", line 217, in _split_line
self._split_line(data_list, '>', line2)
  [Previous line repeated 984 more times]
  File "/usr/lib/python3/dist-packages/icdiff.py", line 180, in _split_line
if ((self._display_len(text) - (text.count('\0') * 3) <=
  File "/usr/lib/python3/dist-packages/icdiff.py", line 163, in _display_len
return sum(width(c) for c in s)
  File "/usr/lib/python3/dist-packages/icdiff.py", line 163, in 
return sum(width(c) for c in s)
  File "/usr/lib/python3/dist-packages/icdiff.py", line 156, in width
if ((isinstance(c, type(u"")) and
RecursionError: maximum recursion depth exceeded while calling a Python object

--
Sometimes it pays to have squirrels in your head running around making
you question everything.  -- Clive Robinson



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-04 Thread davidson

On Tue, 4 Apr 2023 davidson wrote:
[trim]

icdiff will not do that. icdiff is faithful to its sources. I have
determined this by trying it out a little myself, and by examining the
command line options documented in its manual page ("man icdiff").

You could give it different sources:

$ icdiff <( tr '\n' ' ' 

Typos ahead:


$ icdiff-flowed () { <( tr '\n' ' ' 

Correction:

 $ icdiff-flowed () { <( tr '\n' ' ' <"$1" ) <( tr '\n' ' ' <"$2" ) ; }


and then use it like so

$ icdiff-flowed file1 file2 | less -R


--
Sometimes it pays to have squirrels in your head running around making
you question everything.  -- Clive Robinson



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-04 Thread davidson

On Mon, 3 Apr 2023 Susmita/Rajib wrote:
[trimmed headers]

[   ...   ]
You have reported that redirecting icdiff output to a file, in your
words, "drops all colors".

And so I have three questions:

[trimmed davidson's questions]

$ icdiff file1 file2 > pretty_diff
$ less -R pretty_diff
[   ...   ]

Yes, thank you. From your indications it became apparent to me the
idiocy that I was engaged in.


No mistakes means no learning. Learning how to make mistakes, to dare
the facts to expose one's false beliefs, is a great art.

Children tend to be adept at this. But grown-ups can do it too with
practice.


I failed to look into what was really meant by your two lines of
codes. I was redirecting the output to a file with a .txt
extension. So when the default application for my Debian
installation, mousepad, opened the file it dropped all colours.
with a lot of extended chars.


The output contains, in addition to the characters that comprise your
document's text, embedded character sequences which you can display
literally with (for example),

 $ cat -v pretty_diff.txt # the digraph '^[' is the ESC character

and these instruct a terminal which implements them to do various
things.

As I understand it, the semantics of these sequences were defined for
terminals. They implement many functions --not just color-- useful for
any teletype-descendant like a unix terminal emulator. Expecting other
applications to implement them too will probably lead to
disappointment. But do prove me wrong if you like.

[trimmed]

This leads me to the next automatic questions:

Would it be possible to increase the column length for the either of
the two files being compared,


I take this to mean that you would like to increase the length of
lines displayed...


so that I could let the terminal window frame occupy the entire
screen space?


...in order to maximise the use of screen real estate.

That is, you'd like to be shown as many characters on one screen as
possible, without a lot of wastefully empty margins.

(I expect I have overstated your intent here. Do correct me.)

It looks to me like icdiff tries to remain faithful to the source
comparands, to the files you request it to compare.

More concretely: Let's say the source files have newlines at a
position no greater than column 55 (say). This means a side-by-side
comparison will require about 113 columns.

Since you have a giant display that can accomodate far more than that,
icdiff displays sizeable righthand margins on each half of a maximised
terminal window.

So you would like icdiff to "flow" the text when it displays each
source on its half of the terminal. You would like icdiff to replace
newlines with spaces, and then wrap them (ie, inserting new newlines)
as appropriate to fill up the right margins on each half.

icdiff will not do that. icdiff is faithful to its sources. I have
determined this by trying it out a little myself, and by examining the
command line options documented in its manual page ("man icdiff").

You could give it different sources:

 $ icdiff <( tr '\n' ' ' 
If that is not possible


I expect it is, but I may not yet fully understand what you are
looking for.


then which application should I use in GUI to have all colours
faithfully represented?


You will have far more experience with the range of GUI applications
that might serve your needs than I ever will. Control by keyboard is a
hard requirement of mine. GUIs, naturally enough, rarely meet it.


This might help me overcome the column restrictions.


Do correct or extend my understanding of what you seek.

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-03 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Mon, 3 Apr 2023 01:27:46 + (UTC)
Message-id: <[] alpine.deb.2.21.2304030127380.28...@azone.org>
In-reply-to: <[]
caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
<[] CAEG4cZWKu1LVJY_Js+VtXA00tVEDPR_JuPaCJ=jrqerae44...@mail.gmail.com>
<[] caeg4czu4zccbkc9fff66nwwr2ubd_1p_z1bdnhrh_sjp3ik...@mail.gmail.com>

[   ...   ]
You have reported that redirecting icdiff output to a file, in your
words, "drops all colors".

And so I have three questions:

1. Show us the full command line you enter, to redirect the output of
icdiff to a file.

2. Show us the full command line you enter, to view the contents of
that file.

3. For a suitable pair of files, report whether colors are displayed
as expected when you do

 $ icdiff file1 file2 > pretty_diff
 $ less -R pretty_diff
[   ...   ]

Yes, thank you. From your indications it became apparent to me the
idiocy that I was engaged in. I failed to look into what was really
meant by your two lines of codes. I was redirecting the output to a
file with a .txt extension. So when the default application for my
Debian installation, mousepad, opened the file it dropped all colours.
with a lot of extended chars.

This time, I just redirected the output to a file without extension.
Yes, your 2nd line, less -R reproduces all colours. I imagined myself
in your position and looked into what was supposedly intended with
those two lines of codes.

So, thank you for bringing to me to notice my idiocy.

This leads me to the next automatic questions:

Would it be possible to increase the column length for the either of
the two files being compared, so that I could let the terminal window
frame occupy the entire screen space?

If that is not possible then which application should I use in GUI to
have all colours faithfully represented? This might help me overcome
the column restrictions.

Thank you, truly.

Best wishes,
Rajib



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-02 Thread davidson

On Sun, 2 Apr 2023 Susmita/Rajib wrote:
[trimmed: email headers]

On Sat, 1 Apr 2023 Susmita/Rajib wrote:

[   ...   ]
You do not tell us what application you are using to view the file
contents. If it is not a terminal application, it might well fail to
independently implement for your delightful spectation the ECMA-48
set graphics control sequences.
[   ...   ]

Sorry for replying late.


Take all the time you like. Eisenhower tells us that what is urgent is
rarely important, and that what is important is rarely urgent.


It is the same lxterminal available with the live ISO as narrated
earlier. Was it not apparent from my email?


I do not recall you specifying here what terminal you use. And it is
interesting to know.

But I meant to ask something different. I will try to be more clear.

You have reported that redirecting icdiff output to a file, in your
words, "drops all colors".

And so I have three questions:

1. Show us the full command line you enter, to redirect the output of
icdiff to a file.

2. Show us the full command line you enter, to view the contents of
that file.

3. For a suitable pair of files, report whether colors are displayed
as expected when you do

 $ icdiff file1 file2 > pretty_diff
 $ less -R pretty_diff

--
"The first beginnings of wisdom," he said, "is to ask questions but
never to answer any. You get wisdom from asking and not from
answering." -- Flann O'Brien, _The Third Policeman_



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-02 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: rhkra...@gmail.com
Date: Sat, 1 Apr 2023 09:07:47 -0400
Message-id: <[] 202304010907.47888.rhkra...@gmail.com>
In-reply-to: <[]
caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>


On Friday, March 31, 2023 11:37:30 PM Susmita/Rajib wrote:
[   ...]
Thanks for the reply!

I don't remember the name of the utility that I used to use in the
Microsoft world, but it was very nice in showing changes within lines
or paragraphs, using underline and crossout (wrong name) ...
...
Aside: I'm not sure I can show crossout in an email, so will precede
and end it with "-".
...
The utility also showed a vertical line at the beginning of either a
line or paragraph that had changed.
...
I don't remember the name of the utility that I used to use in the
Microsoft world, but it was very nice in showing changes within lines
or paragraphs, using underline and crossout (wrong name).
[   ...   ]

In your later reply you were helped by debian-u...@howorth.org.uk to
have recalled the MS application called MS-Word. I had used it too
till 2008. It was called "show/hide Corrections" that had to be
activated from the Options menu. It would strike through (not
underline) changed lines/words and mark the corrected parts in red.

Best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-02 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Sat, 1 Apr 2023 10:54:06 + (UTC)
Message-id: <[] alpine.deb.2.21.2304011044320.15...@azone.org>
In-reply-to: <[]
caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
<[] caeg4czvce+49-mkwgw7le3l1t6ztsak7jd3kchkevfgh303...@mail.gmail.com>

On Sat, 1 Apr 2023 Susmita/Rajib wrote:

[   ...   ]
You do not tell us what application you are using to view the file
contents. If it is not a terminal application, it might well fail to
independently implement for your delightful spectation the ECMA-48 set
graphics control sequences.
[   ...   ]

Sorry for replying late.
It is the same lxterminal available with the live ISO as narrated earlier.
Was it not apparent from my email?

Best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread rhkramer
On Saturday, April 01, 2023 10:22:24 AM debian-u...@howorth.org.uk wrote:
> rhkra...@gmail.com wrote:
> > I don't remember the name of the utility that I used to use in the
> > Microsoft world, but it was very nice in showing changes within lines
> > or paragraphs, using underline and crossout (wrong name).

> It sounds like you're describing the way Microsoft Word displays
> differences between versions. 

Yes, exactly.  (But there was also a non-Microsoft utility that did (just 
about) the same thing.)

> I believe LibreOffice will do something
> very much the same.

Good to know, I'll have to try that some time.  (I do most of my writing in an 
editor these days.)

-- 
rhk 

(sig revised 20230312 -- modified first paragraph, some other irrelevant 
wordsmithing)

| No entity has permission to use this email to train an AI. 



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread debian-user
rhkra...@gmail.com wrote:
> On Friday, March 31, 2023 11:37:30 PM Susmita/Rajib wrote:
> > Suppose I wrote a book book1.txt. I then send it to an editor who
> > corrects the initial mistakes, altering some lines while doing so,
> > renaming to another file book2.txt.
> > 
> > When I receive the editor's correction, I don't accept them
> > straightaway, but based on his suggestions I change my book1 and
> > edit and alter it further. Diff helps in comparing the two draft
> > editions.
> > 
> > This one cycle could again be repeated.  
> 
> > I checked wdiff and also dwdiff. But they are very bland
> > and very complicated to handle as dwdiff uses a lot of braces with +
> > and - signs, but doesn't present the two files side by side for
> > intuitive/visual comparison.  
> 
> Thanks for the reply!
> 
> I don't remember the name of the utility that I used to use in the
> Microsoft world, but it was very nice in showing changes within lines
> or paragraphs, using underline and crossout (wrong name).  
> 
> Just to create an example, suppose I changed the previious paragraph
> to say "I never used in Linux:" then that utility would show
> something like what I show below.
> 
> Aside: I'm not sure I can show crossout in an email, so will precede
> and end it with "-".
> 
> The utility also showed a vertical line at the beginning of either a
> line or paragraph that had changed.
> 
> I don't remember the name of the utility that I used to use in the
> Microsoft world, but it was very nice in showing changes within lines
> or paragraphs, using underline and crossout (wrong name).  
> 
> 
> | I don't remember the name of the utility that I *never used in
> Linux:* -used to use in the Microsoft world-, but it was very nice in
> showing changes within lines or paragraphs, using underline and
> crossout (wrong name).  

It sounds like you're describing the way Microsoft Word displays
differences between versions. I believe LibreOffice will do something
very much the same.

> I found that very useful for generally text based documents like
> specifications and contracts.
> 
> It did have trouble "resynchronizing" -- I mean, for example, if a
> section of text was not changed but moved a fair distance (for some
> definition of "fair") it often showed that as a deletion of the text
> from the original location and insertion of the (unchaged) text in a
> new location (which wasn't necessarily all bad).
> 
> IIRC, there was another problem that I characterized as trouble with 
> resynchronizing, but, atm, I can't recall any details.
> 
> When I moved to Linux, I looked for a similar utility, and the
> closest I could find (at the time -- possibly 20 years ago) was wdiff.
> 
> I hope you find wnat you're looking for (or maybe even something
> better ;-)
> 



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread rhkramer
On Saturday, April 01, 2023 09:07:47 AM rhkra...@gmail.com wrote:
> On Friday, March 31, 2023 11:37:30 PM Susmita/Rajib wrote:
> I don't remember the name of the utility that I used to use in the
> Microsoft world, but it was very nice in showing changes within lines or
> paragraphs, using underline and crossout (wrong name).

Ahh, some things are coming back to me (it is interesting getting old -- among 
other things, I'm remembering things from long ago that I had forgotten -- I 
sort of wonder if that is a slow motion version of my life flashing before my 
eyes which might mean I'm in deep trouble ;-)

Anyway, I now remember that there were at least two ways that I found to do 
that in the Microsoft world -- one was a standalone utility, which name I 
still don't remember, but the other was a feature built into Microsoft Word 
(at least in the versions I used 20 to 30 years ago).

I don't know if [Libre | Open] Office has a similar feature.

Far aside: I am remembering that I once wrote a literate program (ala Knuth) 
in Microsoft Word (and it worked) -- I could (easily compile it from the Word 
document, or view it with or without the "literacy".  Unfortunately, the 
client company went out of business before the program was put in service.  
(Wouldn't you be worried if you remembered something like that ;-)

-- 
rhk 

(sig revised 20230312 -- modified first paragraph, some other irrelevant 
wordsmithing)

| No entity has permission to use this email to train an AI. 



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread rhkramer


On Friday, March 31, 2023 11:37:30 PM Susmita/Rajib wrote:
> Suppose I wrote a book book1.txt. I then send it to an editor who
> corrects the initial mistakes, altering some lines while doing so,
> renaming to another file book2.txt.
> 
> When I receive the editor's correction, I don't accept them
> straightaway, but based on his suggestions I change my book1 and edit
> and alter it further. Diff helps in comparing the two draft editions.
> 
> This one cycle could again be repeated.

> I checked wdiff and also dwdiff. But they are very bland
> and very complicated to handle as dwdiff uses a lot of braces with +
> and - signs, but doesn't present the two files side by side for
> intuitive/visual comparison.

Thanks for the reply!

I don't remember the name of the utility that I used to use in the Microsoft 
world, but it was very nice in showing changes within lines or paragraphs, 
using underline and crossout (wrong name).  

Just to create an example, suppose I changed the previious paragraph to say "I 
never used in Linux:" then that utility would show something like what I show 
below.

Aside: I'm not sure I can show crossout in an email, so will precede and end 
it with "-".

The utility also showed a vertical line at the beginning of either a line or 
paragraph that had changed.

I don't remember the name of the utility that I used to use in the Microsoft 
world, but it was very nice in showing changes within lines or paragraphs, 
using underline and crossout (wrong name).  


| I don't remember the name of the utility that I *never used in Linux:* -used 
to use in the Microsoft world-, but it was very nice in showing changes within 
lines or paragraphs, using underline and crossout (wrong name).  

I found that very useful for generally text based documents like specifications 
and contracts.

It did have trouble "resynchronizing" -- I mean, for example, if a section of 
text was not changed but moved a fair distance (for some definition of "fair") 
it often showed that as a deletion of the text from the original location and 
insertion of the (unchaged) text in a new location (which wasn't necessarily 
all bad).

IIRC, there was another problem that I characterized as trouble with 
resynchronizing, but, atm, I can't recall any details.

When I moved to Linux, I looked for a similar utility, and the closest I could 
find (at the time -- possibly 20 years ago) was wdiff.

I hope you find wnat you're looking for (or maybe even something better ;-)

-- 
rhk 

(sig revised 20230312 -- modified first paragraph, some other irrelevant 
wordsmithing)

| No entity has permission to use this email to train an AI. 



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread Nate Bargmann
I prefer vimdiff.

- Nate

-- 
"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819



signature.asc
Description: PGP signature


Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread Max Nikulin

On 01/04/2023 14:59, DdB wrote:

In fact, unfortunately, i did not understand the necessity to wrap the
output, as i am happily using the synchronised scrollbar (inside meld)
in such cases, but ofc, that may not fit your use case.


If it is prose text formatted as a line per paragraph then wrapped lines 
become a must have feature. I do not use such approach, but sometimes I 
use :wrap command in vimdiff. I tried meld several years ago, but I 
found no reason to use it instead of vim. Out of curiosity I have tried 
"meld wrap line" in a search engine and got a couple of stackoverflow 
questions. Answers recommend Meld → Preferences → Editor → Enable text 
wrapping.


I believe that an editor is suited much better than a viewer for 
reviewing of edited version of text. Certainly changes should be tracked 
in a version control system.




Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread davidson

On Sat, 1 Apr 2023 davidson wrote:

The "colors" are control sequences, instructions for terminal
emulators conforming to a standard. Terminals understand them to mean
"now paint glyphs red" or "now make them bold" or "now stop doing all
that fancy stuff" etc.


Erm, what I meant to say is that the instructions are for conforming
terminals.

And a terminal *emulator* knows what they mean, because it is an
emulator of terminals.

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread davidson

On Sat, 1 Apr 2023 Susmita/Rajib wrote:

[   ...   ]
Try

icdiff file1 file2 | less -R

and report back.
[   ...   ]

Yes, it worked. Worked better than the code-line with " | more".
Mouse-scrolling working both ways. So really thank you.

My need should have been fulfilled so far as the purpose of the
present thread is concerned. But I have another immediately related
query: how could I capture the output from the code-line with all
its colours to a file on the HDD?


The "colors" are control sequences, instructions for terminal
emulators conforming to a standard. Terminals understand them to mean
"now paint glyphs red" or "now make them bold" or "now stop doing all
that fancy stuff" etc.


Then repeated invoking the line won't be required.  "> file.txt"
drops all colours.


You do not tell us what application you are using to view the file
contents. If it is not a terminal application, it might well fail to
independently implement for your delightful spectation the ECMA-48 set
graphics control sequences.

Applications that transparently pass such sequences to a terminal
permit it to paint the glyphs as the control sequences direct.

 $ icdiff file1 file2 > pretty_diff
 $ less -R pretty_diff # Still pretty?

--
Believe you do in the church, not in front of the computer, when
we see the output we can conclude ourself. -- deloptes



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: 
Date: Sat, 1 Apr 2023 10:14:44 +0200
Message-id: 
In-reply-to: <[]
CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
<[] CAEG4cZVrPz=aZN6C0V0J3EPYMrH=UGkWcbVCc8xY=31ff_p...@mail.gmail.com>
<[] CAEG4cZUXaUAxG=0zlwpxuy44x9rtf7tnewvgfuddmzq7ile...@mail.gmail.com>

On Sat, Apr 01, 2023 at 12:10:27PM +0530, Susmita/Rajib wrote:
[   ...   ]
> Strange, isn't it, Mr. Tomas? They named the project as OpenAI.

Perhaps (quite probably) the original authors dreamt of some
openness. Then, big Microsoft money flowed in.

Those things happen time and again. Remember when Google had
"do no evil" as motto?

Yes, I have a problem with the Android ecosystem, closed source and
the restrictions on the synthetic speech binary. I remember that I had
talked about the libttspico0 package, the svox binary and the
pico2wave program generating good quality TTS.

I have an intuitive belief that if the phonemes are broken down
further into sub-phonemes like it is done in differential calculus,
into tiny 횫s, then the natural voices could well be possible even in
Debian across the board. But I am not a programmer. So I can't
translate my intuition into a real binary.

[   ...   ]
> Would
> like to know the aspects on "... Besides, it's being used in very
> free-software unfriendly ways, but this
> is a whole different story."

I'm not going into big depths here. One use of OpenAI's software,
though, has been discussed in this list: Github Copilot (a Microsoft
product). It uses all the software published under Github (even
that published under copyleft licenses) without even helping the
users to follow the license the software is coming from.

Microsoft says this is no problem. On the other hand, they don't
train Copilot with their own proprietary software (they seem to
see a problem there).

I'm convinced that they are trying to dilute the significance
of copyleft licenses. I don't think that's their main thrust,
but they see that as a collateral benefit.

This is, in my eyes, hostile to free software.

Cheers
-- 
t

[   ...   ]

Thank you, Mr. Tomas. You have given me a direction to find out more.
Yes, Doze's "proprietary"-ty is troublesome. One day I might repackage
free air as cleaned, pure air and charge you for it.

Thank you and best wishes,
Rajib
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: davidson 
Date: Sat, 1 Apr 2023 07:34:39 + (UTC)
Message-id: <[] alpine.deb.2.21.2304010734350.15...@azone.org>
In-reply-to: <[]
caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>

Dear Mr. Davidson, thank you for your reply. My lines are interspersed
in between your lines to maintain their relevance.

[   ...   ]
"Didn't work." A remarkably inarticulate non-description, and
uncharacteristic of our honored declaimant.
[   ...   ]
Wow! What exposition! But the inspiration to address my senior
user-group members thus is felt from within, not merely rhetorical.
You all, who guide me so well with your insights and experiences, are
truly my leaders and seniors in the present field. And indeed, I shall
forever remain a novice in these matters.


[   ...   ]
Try

 icdiff file1 file2 | less -R

and report back.
[   ...   ]

Yes, it worked. Worked better than the code-line with " | more".
Mouse-scrolling working both ways. So really thank you.

My need should have been fulfilled so far as the purpose of the
present thread is concerned. But I have another immediately related
query:  how could I capture the output from the code-line with all its
colours to a file on the HDD? Then repeated invoking the line won't be
required.  "> file.txt" drops all colours.

Thank you, my leaders and seniors on the debian-user group for the
support that you have provided.

Best wishes,
Rajib B
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread tomas
On Sat, Apr 01, 2023 at 12:10:27PM +0530, Susmita/Rajib wrote:
> To: debian-user@lists.debian.org
> Subject: Re: Which Diff tool could I use for visually comparing
> two text files where Word Wrap is possible?
> From: 
> Date: Sat, 1 Apr 2023 07:56:24 +0200
> Message-id: <[] zcfhibipctx8o...@tuxteam.de>
> In-reply-to: <[]
> caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
> References:
> 
> 
> <[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
> 
> On Sat, Apr 01, 2023 at 09:07:30AM +0530, Susmita/Rajib wrote:
> 
> [...]
> 
> > The above limitations directs me to suggest to Debian Teams across all
> > Mailing Lists and the Board to have GPT4 added to extend
> > functionalities of GNU-Linux systems [...]
> 
> GPT is not free software, so it can't be included in Debian.
> 
> Besides, it's being used in very free-software unfriendly ways, but this
> is a whole different story.
> 
> Cheers
> -- 
> t
> 
> 
> [ ... ]
> 
> Strange, isn't it, Mr. Tomas? They named the project as OpenAI.

Perhaps (quite probably) the original authors dreamt of some
openness. Then, big Microsoft money flowed in.

Those things happen time and again. Remember when Google had
"do no evil" as motto?

> Would
> like to know the aspects on "... Besides, it's being used in very
> free-software unfriendly ways, but this
> is a whole different story."

I'm not going into big depths here. One use of OpenAI's software,
though, has been discussed in this list: Github Copilot (a Microsoft
product). It uses all the software published under Github (even
that published under copyleft licenses) without even helping the
users to follow the license the software is coming from.

Microsoft says this is no problem. On the other hand, they don't
train Copilot with their own proprietary software (they seem to
see a problem there).

I'm convinced that they are trying to dilute the significance
of copyleft licenses. I don't think that's their main thrust,
but they see that as a collateral benefit.

This is, in my eyes, hostile to free software.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread DdB
Am 01.04.2023 um 05:37 schrieb Susmita/Rajib:
> Dear Mr. DdB:
> I fondly remember my interaction with you some time during May 2022.
> Perhaps you have overlooked that I needed text wrapping for diff. I
> have checked the synaptic screenshot for meld, have installed and
> tried it. But it too suffers from the lack of text wrapping function.
> For huge text files it is thus problematic. Is a text wrap option
> available? Am I missing something?

Thank you, Sir, for your exquisite feedback. From what i read, your
problem found a resolution suiting your needs, which i refrain from
reading as an aprils fool prank. ;-)

In fact, unfortunately, i did not understand the necessity to wrap the
output, as i am happily using the synchronised scrollbar (inside meld)
in such cases, but ofc, that may not fit your use case. Sorry for that.


Happy diffing
DdB



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread davidson

On Sat, 1 Apr 2023 Susmita/Rajib wrote:

My illustrious team leaders and senior debian-user list-members,

[trimmed: admirably comprehensive description of OPs use-case]

Diff helps in comparing the two draft editions.


It does indeed do what it was designed to do.


Dear Mr. l0f4r0:
that pointer, 
https://unix.stackexchange.com/questions/537418/how-to-make-text-wrap-with-diff-y;
indeed helped and led me to icdiff which is
wonderful. Unfortunately, for two very large text files, the
terminal truncates the beginning and just highlights the end
sections of the files.


As you have discovered, if you do not pipe output to a pager, it will
not be paged.


Icdiff didn't work with " | less".


"Didn't work." A remarkably inarticulate non-description, and
uncharacteristic of our honored declaimant.

Try

 icdiff file1 file2 | less -R

and report back.


But it sure worked with " | more".

Similarly, with diff -y <(fold -s -w72 file1) <(fold -s -w72 file2) -W
200, the beginning is truncated and only the end is displayed. And
yes, it works with " | more". But it is bland.


"Bland" is not a bug. If "spicy" is a requirement for your
professional tools, my sympathy dwindles to a trickle.


Without colours differences can't be spotted so easily.


One gets the feeling that you find colors very helpful. Sounds like a
requirement to me. Say so prominently:

"I require differences to be highlighted in vibrant color."

[trimmed: copious acknowledgments]

Bottom line is: icdiff is wonderful, but from a terminal it becomes
limited. Can;t a good programmer have icdiff ported to GUI?


In its present form its output can be piped to other utilities, such
as the pagers more, less, and most.

This is compositionality, which multiplies the usefulness of a
tool. Toolmakers appreciate this, as do intelligent tool users.


It would be the best solution available for me, and for people like
me.

[rest trimmed]

If you are in the business of producing and processing text, it might
be more productive for you to invest more time in learning how to take
professional advantage of unix text-processing tools, and to spend
less time trying to tell the rare developer that may peruse
debian-user what they ought to develop for you.

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread David
On Sat, 2023-04-01 at 12:10 +0530, Susmita/Rajib wrote:
>     To: debian-user@lists.debian.org
>     Subject: Re: Which Diff tool could I use for visually comparing
> two text files where Word Wrap is possible?
>     From: 
>     Date: Sat, 1 Apr 2023 07:56:24 +0200
>     Message-id: <[] zcfhibipctx8o...@tuxteam.de>
>     In-reply-to: <[]
> caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
>     References:
> 
> 
> <[] 
> caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
> 
> On Sat, Apr 01, 2023 at 09:07:30AM +0530, Susmita/Rajib wrote:
> 
> [...]
> 
> > The above limitations directs me to suggest to Debian Teams across
> > all
> > Mailing Lists and the Board to have GPT4 added to extend
> > functionalities of GNU-Linux systems [...]
> 
> GPT is not free software, so it can't be included in Debian.

Russia is currently developing an equivalent, so it may pay to keep an
eye on that. They have already developed an equivalent to ChatGPT.
Cheers!





Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-04-01 Thread Susmita/Rajib
To: debian-user@lists.debian.org
Subject: Re: Which Diff tool could I use for visually comparing
two text files where Word Wrap is possible?
From: 
Date: Sat, 1 Apr 2023 07:56:24 +0200
Message-id: <[] zcfhibipctx8o...@tuxteam.de>
In-reply-to: <[]
caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>
References:


<[] caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com>

On Sat, Apr 01, 2023 at 09:07:30AM +0530, Susmita/Rajib wrote:

[...]

> The above limitations directs me to suggest to Debian Teams across all
> Mailing Lists and the Board to have GPT4 added to extend
> functionalities of GNU-Linux systems [...]

GPT is not free software, so it can't be included in Debian.

Besides, it's being used in very free-software unfriendly ways, but this
is a whole different story.

Cheers
-- 
t


[ ... ]

Strange, isn't it, Mr. Tomas? They named the project as OpenAI. Would
like to know the aspects on "... Besides, it's being used in very
free-software unfriendly ways, but this
is a whole different story."
You could write to me privately, as this forum shouldn't be used for
our discussions on the issue.
Best wishes,
Rajib



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread tomas
On Sat, Apr 01, 2023 at 09:07:30AM +0530, Susmita/Rajib wrote:

[...]

> The above limitations directs me to suggest to Debian Teams across all
> Mailing Lists and the Board to have GPT4 added to extend
> functionalities of GNU-Linux systems [...]

GPT is not free software, so it can't be included in Debian.

Besides, it's being used in very free-software unfriendly ways, but this
is a whole different story.

Cheers
-- 
t


signature.asc
Description: PGP signature


Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread Susmita/Rajib
My illustrious team leaders and senior debian-user list-members,

Thank you for replying to my email and for your help.

I had posted another, a second message on the issue and clarified my
requirements. But between this time, a couple of emails were received
from Mr. Davidson, and also from Mr. Stefan Monnier, Mr. Van Snyder
and Mr. Greg Wooledge.

I thank Mr. Davidson and Mr. Greg Wooledge for their advice. I fondly
remember Mr. Wooledge and his support earlier too.

Since my earlier 2nd post on this very subject at Sat, 1 Apr 2023
09:07:30 +0530 with message-Id:
caeg4czus4dyt02pvm5byvrpxtxvdeybthfgwhrhi80upoy9...@mail.gmail.com
makes my need clear, I would like to avoid diff. My reason has been
posted in that earlier 2nd post.

Dear Mr. Stefan Monnier and Mr. Van Snyder:
Unfortunately, I once tried to learn emacs but it is complex. So it is
difficult for me to use diff from within emacs. I am sorry that I am
not a worthy student.

I would refer to my earlier post but like to repeat the last
paragraphs of that post:
[quote]
Bottom line is: icdiff is wonderful, but from a terminal it becomes
limited. Can;t a good programmer have icdiff ported to GUI? It would
be the best solution available for me, and for people like me.

The above limitations directs me to suggest to Debian Teams across all
Mailing Lists and the Board to have GPT4 added to extend
functionalities of GNU-Linux systems, for example, in this present
case, have icdiff extended to a GUI, and then have gifted and humane
programmers work in tandem with GPT4 to plug in the insecurities
accompanying a new program.

Thank you for your suggestions. Shall be expecting better solutions
with my having explained my needs clearer this time.
[/quote]

Best wishes,
Rajib B
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread Susmita/Rajib
My illustrious team leaders and senior debian-user list-members,

Thank you for replying to my email and for your help.

The situation is complex. The alteration can't be straightaway applied
by plain replacing.
I will try to illustrate the situation with a clear example:

Suppose I wrote a book book1.txt. I then send it to an editor who
corrects the initial mistakes, altering some lines while doing so,
renaming to another file book2.txt.

When I receive the editor's correction, I don't accept them
straightaway, but based on his suggestions I change my book1 and edit
and alter it further. Diff helps in comparing the two draft editions.

This one cycle could again be repeated.

Dear Mr. l0f4r0:
that pointer, 
https://unix.stackexchange.com/questions/537418/how-to-make-text-wrap-with-diff-y;
indeed helped and led me to icdiff which is wonderful. Unfortunately,
for two very large text files, the terminal truncates the beginning
and just highlights the end sections of the files. Icdiff didn't work
with " | less". But it sure worked with " | more".

Similarly, with diff -y <(fold -s -w72 file1) <(fold -s -w72 file2) -W
200, the beginning is truncated and only the end is displayed. And
yes, it works with " | more". But it is bland. Without colours
differences can't be spotted so easily.

Of course, I could use icdiff part by part also. Though tedious, might
help. But presently, I am thinking of sticking to icdiff with " |
more".

Dear Mr. Kramer:
Thank you. I fondly remember my interactions with you on several
occasions. I checked wdiff and also dwdiff. But they are very bland
and very complicated to handle as dwdiff uses a lot of braces with +
and - signs, but doesn't present the two files side by side for
intuitive/visual comparison.
And regarding your "... A person who writes a sig this long probably
has issues and disrespects (and offends) a large number of readers.
;-) ...", yes it is generally true. For me, the post below your
solution did confuse me, but I am generally adept at skimming and
skipping paras.

Dear Mr. DdB:
I fondly remember my interaction with you some time during May 2022.
Perhaps you have overlooked that I needed text wrapping for diff. I
have checked the synaptic screenshot for meld, have installed and
tried it. But it too suffers from the lack of text wrapping function.
For huge text files it is thus problematic. Is a text wrap option
available? Am I missing something?

Dear Mr. local10:
I can't try kompare though meld appears to be monocrome. Since my
Desktop Environment is lxde, installing kompare, accompanied by a huge
download of kde packages, is impossible unless I use knoppix, which I
do.

Dear Mr. Davidson:
I have already mentioned about diff above. So won't repeat it. But
thank you very much for the line.

Bottom line is: icdiff is wonderful, but from a terminal it becomes
limited. Can;t a good programmer have icdiff ported to GUI? It would
be the best solution available for me, and for people like me.

The above limitations directs me to suggest to Debian Teams across all
Mailing Lists and the Board to have GPT4 added to extend
functionalities of GNU-Linux systems, for example, in this present
case, have icdiff extended to a GUI, and then have gifted and humane
programmers work in tandem with GPT4 to plug in the insecurities
accompanying a new program.

Thank you for your suggestions. Shall be expecting better solutions
with my having explained my needs clearer this time.

Best wishes,
Rajib B
Etc.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread Greg Wooledge
On Sat, Apr 01, 2023 at 01:41:22AM +, davidson wrote:
> On Sat, 1 Apr 2023 davidson wrote:
> > Start here instead:
> > 
> > $ diff file1 file2
> > 
> > It displays the differences, and your terminal will wrap lines (and
> > break words) to fit the window for you.
> > 
> > Does it do what you want?
> 
> A concise explanation of diff's default output format (which is a
> little cryptic but quite simple) can be viewed in the info browser
> with
> 
>  $ info -n "Detailed Normal" diffutils # type 'q' to quit
> 
> or written to a text file with
> 
>  $ info -o diff_format_explained.txt -n "Detailed Normal" diffutils

Most people prefer diff -u format.  Here's a quick sample of the three
formats:

unicorn:~$ diff <(seq 1 3) <(printf '1\n4\n3\n')
2c2
< 2
---
> 4


unicorn:~$ diff -c <(seq 1 3) <(printf '1\n4\n3\n')
*** /dev/fd/63  Fri Mar 31 21:53:34 2023
--- /dev/fd/62  Fri Mar 31 21:53:34 2023
***
*** 1,3 
  1
! 2
  3
--- 1,3 
  1
! 4
  3


unicorn:~$ diff -u <(seq 1 3) <(printf '1\n4\n3\n')
--- /dev/fd/63  2023-03-31 21:53:37.023781025 -0400
+++ /dev/fd/62  2023-03-31 21:53:37.023781025 -0400
@@ -1,3 +1,3 @@
 1
-2
+4
 3


The first one (default) gives no context lines.  It simply says "replace
line 2, which is "2", with "4".  This works fine for some inputs, but it
doesn't allow for applying a code patch to a function that has moved a
few lines down in the file since the patch was written.

So, the second format, "context", was introduced.  It shows the lines
before and after the change.  This allows the patch applier to look around
in the file and find the appropriate place to apply the patch, if the
content has moved around.

The third format, "unified", is just a more compact version of "context".
It shows the lines before and after the change, but only once instead
of twice.

In some ways, the "context" format can be easier to read, because you
see the actual new content exactly as it should appear, without the
old lines interwoven.

On the other hand, the "unified" format shows you the before and after
lines right next to each other.  In some cases, that can be easier to
use.  Especially once you get used to it.



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread davidson

On Sat, 1 Apr 2023 davidson wrote:

Start here instead:

$ diff file1 file2

It displays the differences, and your terminal will wrap lines (and
break words) to fit the window for you.

Does it do what you want?


A concise explanation of diff's default output format (which is a
little cryptic but quite simple) can be viewed in the info browser
with

 $ info -n "Detailed Normal" diffutils # type 'q' to quit

or written to a text file with

 $ info -o diff_format_explained.txt -n "Detailed Normal" diffutils

--
We've been looking for the enemy for some time now. We've finally found him.
We're surrounded. That simplifies things.  -- Chesty Puller



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread davidson

On Fri, 31 Mar 2023 davidson wrote:

Some elaboration on my first take.


On Fri, 31 Mar 2023 Susmita/Rajib wrote:

My dear illustrious leaders and senior debian-user list-members,


I neglected to notice the proper subset of readers on whom you
intended to inflict your request.


I tried diffuse,


I see that diffuse has quite a number of features:

 diffuse - graphical tool for merging and comparing text files
  Diffuse is a graphical tool for merging and comparing text
  files. Diffuse is able to compare an arbitrary number of files
  side-by-side and gives users the ability to manually adjust
  line-matching and directly edit files. Diffuse can also retrieve
  revisions of files from bazaar, CVS, darcs, git, mercurial,
  monotone, Subversion and GNU Revision Control System (RCS)
  repositories for comparison and merging.

Which of these features do you *require*?


but it appears to me that it suffers from a limitation so far as my
need is concerned. It compares files by lines and line numbers, so
I can't use word-wrap


By "word-wrap", do you mean you need to break *lines* into smaller
lines (so that your screen can accomodate their content)?

Or do you mean instead that you are dealing with words so long that
some words won't fit within a single line on your screen until you
turn them into smaller words by inserting newlines.


to have the differences between two files within the program window
without venturing out to the right within the two file windows.


I see (from its package description above) that diffuse can display
files' content side-by-side. Is this a requirement of yours?

Because if it is not, you can double your effective screen width by
simply discarding the side-by-side feature.


$ diff <(fmt file1) <(fmt file2)

fmt has a -w option to adjust the max line width. The default is 75.


If I may say so myself, this is almost certainly not a helpful
solution. How embarrassing.

Start here instead:

 $ diff file1 file2

It displays the differences, and your terminal will wrap lines (and
break words) to fit the window for you.

Does it do what you want?


Is there a way to Word Wrap? Am I making a mistake here? Which program
would be the best suited for my work for comparing text files?


It depends on your precise requirements, which we cannot know until
you tell us what they are. (Sometimes one does not know oneself. This
is also okay.)

I don't believe you have specified any of your requirements that the
solution above does not provide.


--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread davidson

On Fri, 31 Mar 2023 Susmita/Rajib wrote:

My dear illustrious leaders and senior debian-user list-members,

I tried diffuse, but it appears to me that it suffers from a
limitation so far as my need is concerned. It compares files by lines
and line numbers, so I can't use word-wrap to have the differences
between two files within the program window without venturing out to
the right within the two file windows.


 $ diff <(fmt file1) <(fmt file2)

fmt has a -w option to adjust the max line width. The default is 75.


Is there a way to Word Wrap? Am I making a mistake here? Which program
would be the best suited for my work for comparing text files?


It depends on your precise requirements, which we cannot know until
you tell us what they are. (Sometimes one does not know oneself. This
is also okay.)

I don't believe you have specified any of your requirements that the
solution above does not provide.

--
Hackers are free people. They are like artists. If they are in a good
mood, they get up in the morning and begin painting their pictures.
-- Vladimir Putin



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread Van Snyder
On Fri, 2023-03-31 at 22:50 +0200, local10 wrote:
> Mar 31, 2023, 16:30 by bkpsusmi...@gmail.com:
> > I tried diffuse, but it appears to me that it suffers from
> > alimitation so far as my need is concerned. It compares files by
> > linesand line numbers, so I can't use word-wrap to have the
> > differencesbetween two files within the program window without
> > venturing out tothe right within the two file windows.
> > Is there a way to Word Wrap? Am I making a mistake here? Which
> > programwould be the best suited for my work for comparing text
> > files?
> 
> Try Kompare. I tried several diff tools but I liked Kompare the most:
> clean, intuitive interface, easy to use, lots of features.

emacs includes a nice side-by-side compare and merge feature.
> Regards,


Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread local10
Mar 31, 2023, 16:30 by bkpsusmi...@gmail.com:

> I tried diffuse, but it appears to me that it suffers from a
> limitation so far as my need is concerned. It compares files by lines
> and line numbers, so I can't use word-wrap to have the differences
> between two files within the program window without venturing out to
> the right within the two file windows.
>
> Is there a way to Word Wrap? Am I making a mistake here? Which program
> would be the best suited for my work for comparing text files?
>


Try Kompare. I tried several diff tools but I liked Kompare the most: clean, 
intuitive interface, easy to use, lots of features.

Regards,



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread DdB
Am 31.03.2023 um 18:13 schrieb Susmita/Rajib:
> My dear illustrious leaders and senior debian-user list-members,
> 
> I tried diffuse, but it appears to me that it suffers from a
> limitation so far as my need is concerned. It compares files by lines
> and line numbers, so I can't use word-wrap to have the differences
> between two files within the program window without venturing out to
> the right within the two file windows.
> 
> Is there a way to Word Wrap? Am I making a mistake here? Which program
> would be the best suited for my work for comparing text files?
> 
> There is a package called diffoscope but it has to install a long list
> of dependent packages in my present Debian system installed from
> "Official Debian GNU/Linux Live 11.6.0 lxde 2022-12-17T11:46"
> 
> Eagerly awaiting your advice.
> 
> Best wishes,
> Rajib B
> Etc.
> 
> 
I may be misunderstanding your needs:
In many cases, i replace diff with meld, an interactive diff UI



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread rhkramer
On Friday, March 31, 2023 12:13:33 PM Susmita/Rajib wrote:
> There is a package called diffoscope but it has to install a long list
> of dependent packages in my present Debian system installed from
> "Official Debian GNU/Linux Live 11.6.0 lxde 2022-12-17T11:46"

It's been quite a while since I actually used diff, but I always preferred a 
word diff (to a line based diff).  Two options are wdiff and wdiff2 (aka mdiff 
-w)

-- 
rhk 

(sig revised 20230312 -- modified first paragraph, some other irrelevant 
wordsmithing)

| No entity has permission to use this email to train an AI. 

If you reply: snip, snip, and snip again; leave attributions; avoid HTML; 
avoid top posting; and keep it "on list".  (Oxford comma (and semi-colon) 
included at no charge.)  If you revise the topic, change the Subject: line.  
If you change the topic, start a new thread.

Writing is often meant for others to read and understand (legal documents 
excepted?) -- make it easier for your reader by various means, including 
liberal use of whitespace (short paragraphs, separated by whitespace / blank 
lines) and minimal use of (obscure?) jargon, abbreviations, acronyms, and 
references.

If someone has already responded to a question, decide whether any response 
you add will be helpful or not ...

A picture is worth a thousand words.  A video (or "audio"): not so much -- 
divide by 10 for each minute of video (or audio) or create a transcript and 
edit it to 10% of the original.

A speaker who uses ahhs, ums, or such may have a real physical or mental 
disability, or may be showing disrespect for his listeners by not properly 
preparing in advance and thinking before speaking. (That speaker might have 
been "trained" to do this by being interrupted often if he pauses.)  (Remember 
Cicero who did not have enough time to write a short missive.)

A radio (or TV) station which broadcasts speakers with high pitched voices (or 
very low pitched / gravelly voices) (which older people might not be able to 
hear properly) disrespects its listeners.   Likewise if it broadcasts 
extraneous or disturbing sounds (like gunfire or crying), or broadcasts 
speakers using their native language (with or without an overdubbed 
translation).

A person who writes a sig this long probably has issues and disrespects (and 
offends) a large number of readers. ;-)
'



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread Stefan Monnier
>> Is there a way to Word Wrap? Am I making a mistake here?
>> Which program would be the best suited for my work for comparing
>> text files?

I'd expect most text editors to do that for you.

E.g. when I ask Emacs to give me a diff for "files with long lines",
the long lines are wrapped and the diff is colored to show the specific
words that are changed within each line.


Stefan



Re: Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread l0f4r0
Hi,

31 mars 2023, 18:30 de bkpsusmi...@gmail.com:

> Is there a way to Word Wrap? Am I making a mistake here? Which program
> would be the best suited for my work for comparing text files?
>
Does that pointer help you?
https://unix.stackexchange.com/questions/537418/how-to-make-text-wrap-with-diff-y

l0f4r0



Which Diff tool could I use for visually comparing two text files where Word Wrap is possible?

2023-03-31 Thread Susmita/Rajib
My dear illustrious leaders and senior debian-user list-members,

I tried diffuse, but it appears to me that it suffers from a
limitation so far as my need is concerned. It compares files by lines
and line numbers, so I can't use word-wrap to have the differences
between two files within the program window without venturing out to
the right within the two file windows.

Is there a way to Word Wrap? Am I making a mistake here? Which program
would be the best suited for my work for comparing text files?

There is a package called diffoscope but it has to install a long list
of dependent packages in my present Debian system installed from
"Official Debian GNU/Linux Live 11.6.0 lxde 2022-12-17T11:46"

Eagerly awaiting your advice.

Best wishes,
Rajib B
Etc.



des listes de diff avec encryption

2021-05-12 Thread Marc Chantreux
> > > > Il suffirait en effet de partager les
> > > > clefs publiques des utilisateurs de la m-l une seule fois et ensuite ils
> > > > utilisent celle du serveur pour l'utilisation quotidienne.
> > > oui mais ... y'a vraiment des gens qui seraient preneurs d'une telle
> > > fonctionalité?
> Ben oui. Un groupe qui voudrait communiquer confidentiellement, non?

j'ai peut-être un biais personnel ici: lorsque je chiffre, c'est toujours

* a destination de quelques personnes seulement
  (déjà parce qu'on est pas nombreux à savoir utiliser gpg ou autres)
* sans nécessité de fonctionnalités propres aux listes (archives,
  modération, ...)
* en limitant au maximum d'avoir un seul point de compromission
  dangereux comme le serait un serveur de listes.

mais je suis curieux d'avoir de bonnes raisons pour plancher sur la
question.

cordialement,
marc



Re: How do I contribute patches to packages (GitLab merge requests or diff -u + bug report)?

2020-11-28 Thread Dan Ritter
Vishal Subramanyam wrote: 
> I wish to contribute patches to Debian packages, but I am confused
> about how I should go about doing so. The Debian Handbook says that
> using GitLab might make it easier for maintainers to merge changes, but
> somebody on an IRC channel told me that the old email-based workflow is
> still the dominant way of delivering patches to developers.
> I find it easier to work with GitLab. What should I do? Should my
> preference depend on the package maintainer's preferences?

Yes, you should definitely send in patches in accordance with
whichever method is currently being used by that package.
Contact the package maintainer or the appropriate team list if
you can't find clear documentation.

If the patches aren't Debian-specific, you may wish to
contribute them upstream, instead or simultaneously.

-dsr-



How do I contribute patches to packages (GitLab merge requests or diff -u + bug report)?

2020-11-28 Thread Vishal Subramanyam
Hey,
I wish to contribute patches to Debian packages, but I am confused
about how I should go about doing so. The Debian Handbook says that
using GitLab might make it easier for maintainers to merge changes, but
somebody on an IRC channel told me that the old email-based workflow is
still the dominant way of delivering patches to developers.
I find it easier to work with GitLab. What should I do? Should my
preference depend on the package maintainer's preferences?

Vishal



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-25 Thread Migrec



Le 25/10/2017 à 10:54, Marc Chantreux a écrit :

salut,


#!/usr/bin/perl -w

my $file1 =  $ARGV[0];
my $file2 =  $ARGV[1];

open(my $old, '<', $file1) or die "Can't open $file1: $!";
open(my $new, '<', $file2) or die "Can't open $file2: $!";

my %found_email = map { (split /;/)[3] => 1 } <$old>;
map {print if not $found_email{ (split /;/)[3] }} <$new>;

pe en rajoutant chomp ?

my ($new,$old) =
map { open my $fh, '<', $_ or die "Can't open $_: $!"; $fh }
@ARGV;

my %found_email = map {chomp; (split /;/)[3] => 1 } <$old>;
map {chomp; print if not $found_email{ (split /;/)[3] }} <$new>;

par contre: ton fichier est un CSV comme son nom l'indique: il y a
plein de cas que tu ne prend pas en compte en splitant naivement sur ';'
(par exemple un champ qui contiendrait un ";").

pour rendre ton script robuste, ne réinvente pas la roue et utilise
Text::CSV ou mieux  Text::CSV::Simple.

si j'en ai le temps, je t'écrirais un exemple plus tard.

Ça passe pas... :-(

$ ./listerLesNouveaux3.pl Ancien.csv Nouveau.csv
Adresseligne2";"";"";"";"";"";""RENOM";"nouveaunom.nouveaupre...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-25 Thread Marc Chantreux
salut,

> #!/usr/bin/perl -w
> 
> my $file1 =  $ARGV[0];
> my $file2 =  $ARGV[1];
> 
> open(my $old, '<', $file1) or die "Can't open $file1: $!";
> open(my $new, '<', $file2) or die "Can't open $file2: $!";
> 
> my %found_email = map { (split /;/)[3] => 1 } <$old>;
> map {print if not $found_email{ (split /;/)[3] }} <$new>;

pe en rajoutant chomp ?

my ($new,$old) =
map { open my $fh, '<', $_ or die "Can't open $_: $!"; $fh }
@ARGV;

my %found_email = map {chomp; (split /;/)[3] => 1 } <$old>;
map {chomp; print if not $found_email{ (split /;/)[3] }} <$new>;

par contre: ton fichier est un CSV comme son nom l'indique: il y a
plein de cas que tu ne prend pas en compte en splitant naivement sur ';'
(par exemple un champ qui contiendrait un ";").

pour rendre ton script robuste, ne réinvente pas la roue et utilise
Text::CSV ou mieux  Text::CSV::Simple.

si j'en ai le temps, je t'écrirais un exemple plus tard.

marc



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-25 Thread Stephane Ascoet
Bonjour, le trop peu connu "Docdiff" pourrait etre une solution. 
Explications sur (c'est un site un peu comme 
celui d'un colistier: 
 
mais dans lequel j'ai helas vu des erreurs/inextactitudes, donc mefiance 
avec les informations qui y figurent)

--
Cordialement, Stephane Ascoet



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-25 Thread Marc Chantreux
> >de meme on filtrera ton 2eme fichier presque de la meme manière
> >
> >map {print if $found_email{ (split /;/)[3] } <$new>;
> 
> Effectivement, c'est bien plus simple ainsi. Malheureusement, je n'y
> connais rien en perl... J'ai juste mis une négation (not)= après le
> dernier if afin de garder que les lignes différentes.

c'est donc

map {print if not $found_email{ (split /;/)[3] } <$new>;

> Mais quoique je fasse, la sortie inclut toute de même les lignes
> faisait suite à un retour chariot... Solution temporaire : supprimer
> la colonne Adresse avec un tableur et passer le script.

oula ... je suis largé aussi ...

marc 



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-25 Thread Alexandre Hoïde
On Wed, Sep 20, 2017 at 04:48:43PM +0200, Migrec wrote:
> Bonjour,

  Bonjour Migrec,

> J'ai un fichier CSV avec des identifiants, des mots de passes et quelques
> autres données.
> J'aimerai extraire les lignes ajoutées au fichier ANCIEN.csv par rapport au
> fichier NOUVEAU.csv. Certains lignes ont été modifiées et celles-ci ne
> m'intéressent pas. À noter que j'ai une adresse mail dans chaque ligne qui
> pourrait servir d'identifiant unique...
> 
> Comment feriez-vous ?

  Je ne vais pas interférer avec votre discussion pour une solution en
Perl, mais je signale une autre option :

$ diff --old-line-format="" --new-line-format='%L' 
--unchanged-line-format=""  

  Les options de « diff » suivantes pourraient également t'être utiles :
  --ignore-blank-lines
  --ignore-case
  --ignore-space-changes

  Pas sûr que cela soit nécessaire mais l'utilitaire suivant pourrait
également t'être utile : $ apt show dos2unix

-- 
 ___
| $ post_tenebras ↲ | waouh!
| GNU\ /|\
|  -- * --  | o
| $ who ↲/ \|_-- ~_|
| Alexandre Hoïde   |  _/| |
 ---



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-25 Thread Migrec

Le 25/10/2017 à 09:00, Dominique Dumont a écrit :

On Tuesday, 24 October 2017 21:46:28 CEST Migrec wrote:

Mais quoique je fasse, la sortie inclut toute de même les lignes faisait
suite à un retour chariot... Solution temporaire : supprimer la colonne
Adresse avec un tableur et passer le script.

Je ne comprends toujours pas le problème. Envoie un exemple si tu veux qu'on
t'aide plus. Sinon on perd trop de temps.
Merci ! J'ai du épurer le fichier des données véritables mais en gros ça 
donne ceci :


Le fichier Ancien.csv :
"ProfilA";"NOM1";"Prénom1";"prenom1.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"NOM2";"prenom2";"prenom2.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"NOM2";"prenom3";"prenom3.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"NOM2";"prenom4";"prenom4.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"nom3";"prenom5";"prenom5.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"nom4";"prenom6";"prenom6.n...@domaine.fr";"AdresseLigne1$Adresseligne2";"";"";"";"";"";""
"ProfilB";"nom4";"prenom7";"prenom7.n...@domaine.fr";"Adresseligne1";"";"";"";"";"";""
"ProfilB";"nom4";"prenom8";"prenom8.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""

Le fichier Nouveau CSV :
"ProfilA";"NOM1";"Prénom1";"prenom1.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"NOM2";"prenom2";"prenom2.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilB";"NOUVEAUNOM";"NOUVEAUPRENOM";"nouveaunom.nouveaupre...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"NOM2";"prenom3";"prenom3.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"NOM2";"prenom4";"prenom4.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"nom3";"prenom5";"prenom5.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"nom4";"prenom6";"prenom6.n...@domaine.fr";"AdresseLigne1
Adresseligne2";"";"";"";"";"";""
"ProfilB";"nom4";"prenom7";"prenom7.n...@domaine.fr";"Adresseligne1";"";"";"";"";"";""
"ProfilB";"nom4";"prenom8";"prenom8.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""

$ ./listerLesNouveaux2.pl Aide\ Debian/Ancien.csv Aide\ Debian/Nouveau.csv
"ProfilB";"NOUVEAUNOM";"NOUVEAUPRENOM";"nouveaunom.nouveaupre...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
Adresseligne2";"";"";"";"";"";""


J'ai bien ma nouvelle ligne mais je me retrouve aussi avec cette ligne 
parasite qui est la suite d'une ligne se terminant par un retour chariot 
à la dos. Je précise que les fichiers sont encodés en dos. Ci-joint les 
fichiers pour examen.



$ cat listerLesNouveaux2.pl
#!/usr/bin/perl -w

my $file1 =  $ARGV[0];
my $file2 =  $ARGV[1];

open(my $old, '<', $file1) or die "Can't open $file1: $!";
open(my $new, '<', $file2) or die "Can't open $file2: $!";

my %found_email = map { (split /;/)[3] => 1 } <$old>;
map {print if not $found_email{ (split /;/)[3] }} <$new>;

--
Migrec
"ProfilA";"NOM1";"Prénom1";"prenom1.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"NOM2";"prenom2";"prenom2.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"NOM2";"prenom3";"prenom3.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"NOM2";"prenom4";"prenom4.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"nom3";"prenom5";"prenom5.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"nom4";"prenom6";"prenom6.n...@domaine.fr";"AdresseLigne1$Adresseligne2";"";"";"";"";"";""
"ProfilB";"nom4";"prenom7";"prenom7.n...@domaine.fr";"Adresseligne1";"";"";"";"";"";""
"ProfilB";"nom4";"prenom8";"prenom8.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"NOM1";"Prénom1";"prenom1.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"NOM2";"prenom2";"prenom2.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilB";"NOUVEAUNOM";"NOUVEAUPRENOM";"nouveaunom.nouveaupre...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"NOM2";"prenom3";"prenom3.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"NOM2";"prenom4";"prenom4.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""
"ProfilA";"nom3";"prenom5";"prenom5.n...@domaine.fr";"";"";"";"";"";"";""
"ProfilB";"nom4";"prenom6";"prenom6.n...@domaine.fr";"AdresseLigne1
Adresseligne2";"";"";"";"";"";""
"ProfilB";"nom4";"prenom7";"prenom7.n...@domaine.fr";"Adresseligne1";"";"";"";"";"";""
"ProfilB";"nom4";"prenom8";"prenom8.n...@domaine.fr";"AdresseLigne1";"";"";"";"";"";""


Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-25 Thread Dominique Dumont
On Tuesday, 24 October 2017 21:46:28 CEST Migrec wrote:
> Mais quoique je fasse, la sortie inclut toute de même les lignes faisait 
> suite à un retour chariot... Solution temporaire : supprimer la colonne 
> Adresse avec un tableur et passer le script.

Je ne comprends toujours pas le problème. Envoie un exemple si tu veux qu'on 
t'aide plus. Sinon on perd trop de temps.

-- 
 https://github.com/dod38fr/   -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/  -o-   irc: dod at irc.debian.org



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-24 Thread Migrec

Le 24/10/2017 à 17:31, Marc Chantreux a écrit :

Oui effectivement il fonctionne ce script perl... mea culpa.
C'est simplement le fichier initial (pas de retour chariot à
l'intérieur des lignes) qui diffère du fichier actuel (retours
chariot dans les lignes).

hello,

il y a pas mal d'amélioration possibles pour rendre ton script
un peu plus facile a maintenir mais voilà celle qui me parait la plus
intéressante

tu écris

my %lines;
foreach (<$old>) {
   my ($f1, $f2, $f3, $email, $f4, $f5, $f6, $f7,$f8) = split /;/;
   $lines{$email} = 1;
}

hors seul le champ $email t'intéresse alors ne garde que celui-ci

my %lines;
foreach (<$old>) {
   my $email = (split /;/)[3];
   $lines{$email} = 1;
}

et là on se rend compte que lines ne contient pas des lignes
mais une paire pour chaque ligne avec une adresse email en clef et
1 comme valeur unique ( $email => 1 ). du coup on peut écrire

my %found_email = map { (split /;/)[3] => 1 } <$old>;

de meme on filtrera ton 2eme fichier presque de la meme manière

map {print if $found_email{ (split /;/)[3] } <$new>;


Effectivement, c'est bien plus simple ainsi. Malheureusement, je n'y 
connais rien en perl... J'ai juste mis une négation (not)= après le 
dernier if afin de garder que les lignes différentes.


Mais quoique je fasse, la sortie inclut toute de même les lignes faisait 
suite à un retour chariot... Solution temporaire : supprimer la colonne 
Adresse avec un tableur et passer le script.


--
Migrec



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-24 Thread Marc Chantreux
> Oui effectivement il fonctionne ce script perl... mea culpa.
> C'est simplement le fichier initial (pas de retour chariot à
> l'intérieur des lignes) qui diffère du fichier actuel (retours
> chariot dans les lignes).

hello, 

il y a pas mal d'amélioration possibles pour rendre ton script
un peu plus facile a maintenir mais voilà celle qui me parait la plus
intéressante

tu écris 

my %lines;
foreach (<$old>) {
  my ($f1, $f2, $f3, $email, $f4, $f5, $f6, $f7,$f8) = split /;/;
  $lines{$email} = 1;
}

hors seul le champ $email t'intéresse alors ne garde que celui-ci

my %lines;
foreach (<$old>) {
  my $email = (split /;/)[3];
  $lines{$email} = 1;
}

et là on se rend compte que lines ne contient pas des lignes
mais une paire pour chaque ligne avec une adresse email en clef et
1 comme valeur unique ( $email => 1 ). du coup on peut écrire

my %found_email = map { (split /;/)[3] => 1 } <$old>;

de meme on filtrera ton 2eme fichier presque de la meme manière

map {print if $found_email{ (split /;/)[3] } <$new>;

marc



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-24 Thread Migrec

Le 24/10/2017 à 15:43, Dominique Dumont a écrit :

On Tuesday, 24 October 2017 14:52:55 CEST Migrec wrote:

e me retrouve avec un fichier issu de DOS (donc des fins de lignes avec
^M$). Jusque là tout va bien mais désormais, j'ai également un caractère
$ dans l'un des champs (c'est un champ de type adresse qui peut contenir
4 lignes donc 3 $ potentiellement).

Option 1
Je traite uniquement les lignes qui commencent par ". Je contourne le
problème. Comment puis-je faire cela ?

Option 2
J'indique à Perl qu'il s'agit de la même ligne lorsqu'il y a un $. Mais
comment ?

Pas sur de comprendre. Perl devrait traiter les '$' venant du fichier d'entrée
comme un autre caractère Bref ton script devrait fonctionner.

Si ce n'est pas le cas, il va nous falloir plus de détails (script et un
exemple d'entrée).


Oui effectivement il fonctionne ce script perl... mea culpa.
C'est simplement le fichier initial (pas de retour chariot à l'intérieur 
des lignes) qui diffère du fichier actuel (retours chariot dans les lignes).

--
Migrec



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-24 Thread Dominique Dumont
On Tuesday, 24 October 2017 14:52:55 CEST Migrec wrote:
> e me retrouve avec un fichier issu de DOS (donc des fins de lignes avec 
> ^M$). Jusque là tout va bien mais désormais, j'ai également un caractère 
> $ dans l'un des champs (c'est un champ de type adresse qui peut contenir 
> 4 lignes donc 3 $ potentiellement).
> 
> Option 1
> Je traite uniquement les lignes qui commencent par ". Je contourne le 
> problème. Comment puis-je faire cela ?
> 
> Option 2
> J'indique à Perl qu'il s'agit de la même ligne lorsqu'il y a un $. Mais 
> comment ?

Pas sur de comprendre. Perl devrait traiter les '$' venant du fichier d'entrée 
comme un autre caractère Bref ton script devrait fonctionner.

Si ce n'est pas le cas, il va nous falloir plus de détails (script et un 
exemple d'entrée).

HTH
-- 
 https://github.com/dod38fr/   -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/  -o-   irc: dod at irc.debian.org



Re: Diff : obtenir uniquement les lignes ajoutées

2017-10-24 Thread Migrec

Le 20/09/2017 à 20:43, Migrec a écrit :
Je ne connais pas du tout le perl (et du coup pas tout compris...) 
mais j'ai réussi à bricoler un peu pour avoir un résultat qui me 
parait satisfaisant.

Merci beaucoup.

 Le script :
#!/usr/bin/perl -w

my $file1 =  $ARGV[0];
my $file2 =  $ARGV[1];

open(my $old, '<', $file1) or die "Can't open $file1: $!";
open(my $new, '<', $file2) or die "Can't open $file2: $!";


 # Lire et indexer le premier fichier
my %lines;
foreach (<$old>) {
   my ($f1, $f2, $f3, $email, $f4, $f5, $f6, $f7,$f8) = split /;/;
   $lines{$email} = 1;
}

# Imprimer ce qui n'est pas dans le premier fichier
foreach (<$new>) {
   my ($f1, $f2, $f3, $email, $f4, $f5, $f6, $f7,$f8) = split /;/;

print unless exists $lines{$email};
}


Bonjour,

Je déterre ce fil de discussion car l'interface qui produit mon fichier 
en entrée a changé. Grr.
Je me retrouve avec un fichier issu de DOS (donc des fins de lignes avec 
^M$). Jusque là tout va bien mais désormais, j'ai également un caractère 
$ dans l'un des champs (c'est un champ de type adresse qui peut contenir 
4 lignes donc 3 $ potentiellement).


Option 1
Je traite uniquement les lignes qui commencent par ". Je contourne le 
problème. Comment puis-je faire cela ?


Option 2
J'indique à Perl qu'il s'agit de la même ligne lorsqu'il y a un $. Mais 
comment ?


--
Migrec



Re: Diff : obtenir uniquement les lignes ajoutées

2017-09-20 Thread Migrec

Le 20/09/2017 17:25, Yves Rutschle a écrit :

On Wed, Sep 20, 2017 at 04:48:43PM +0200, Migrec wrote:

J'ai un fichier CSV avec des identifiants, des mots de passes et quelques
autres données.

C'est mal, il faut hacher les mots de passe.


Malheureusement, ce n'est pas moi qui produit le fichier...


J'aimerai extraire les lignes ajoutées au fichier ANCIEN.csv par rapport au
fichier NOUVEAU.csv. Certains lignes ont été modifiées et celles-ci ne
m'intéressent pas. À noter que j'ai une adresse mail dans chaque ligne qui
pourrait servir d'identifiant unique...

En Perl, avec un tableau associatif indexé par adresse mail,
par ex. avec des fichiers:

toto:tata:f...@bar.com:0:2


# Lire et indexer le premier fichier
my %lines;
foreach (<$file1>) {
my ($f1, $f2, $email, $f3, $f4) = split /:/;
$lines{$email} = 1;
}

# Imprimer ce qui n'est pas dans le premier fichier
foreach (<$file2>) {
my ($f1, $f2, $email, $f3, $f4) = split /:/;
print unless exists $lines{$email};
}



Je ne connais pas du tout le perl (et du coup pas tout compris...) mais 
j'ai réussi à bricoler un peu pour avoir un résultat qui me parait 
satisfaisant.

Merci beaucoup.

 Le script :
#!/usr/bin/perl -w

my $file1 =  $ARGV[0];
my $file2 =  $ARGV[1];

open(my $old, '<', $file1) or die "Can't open $file1: $!";
open(my $new, '<', $file2) or die "Can't open $file2: $!";


 # Lire et indexer le premier fichier
my %lines;
foreach (<$old>) {
   my ($f1, $f2, $f3, $email, $f4, $f5, $f6, $f7,$f8) = split /;/;
   $lines{$email} = 1;
}

# Imprimer ce qui n'est pas dans le premier fichier
foreach (<$new>) {
   my ($f1, $f2, $f3, $email, $f4, $f5, $f6, $f7,$f8) = split /;/;

print unless exists $lines{$email};
}



Re: Diff : obtenir uniquement les lignes ajoutées

2017-09-20 Thread Erwan David
Le 09/20/17 à 17:25, Yves Rutschle a écrit :
> On Wed, Sep 20, 2017 at 04:48:43PM +0200, Migrec wrote:
>> J'ai un fichier CSV avec des identifiants, des mots de passes et quelques
>> autres données.
> 
> C'est mal, il faut hacher les mots de passe.

ET les saler avant, contrairement au steak.



Re: Diff : obtenir uniquement les lignes ajoutées

2017-09-20 Thread Vincent Lefevre
On 2017-09-20 16:48:43 +0200, Migrec wrote:
> Bonjour,
> 
> J'ai un fichier CSV avec des identifiants, des mots de passes et quelques
> autres données.
> J'aimerai extraire les lignes ajoutées au fichier ANCIEN.csv par rapport au
> fichier NOUVEAU.csv. Certains lignes ont été modifiées et celles-ci ne
> m'intéressent pas. À noter que j'ai une adresse mail dans chaque ligne qui
> pourrait servir d'identifiant unique...
> 
> Comment feriez-vous ?

Donc ce que tu veux, ce sont toutes les lignes qui ont un nouvel
identifiant. Je vois deux solutions:

1. Écrire un script dans un langage qui supporte les tableaux
   associatifs (e.g. les hash en Perl), et utiliser l'identifiant
   comme clé. D'abord, définir les clés existantes en lisant
   ANCIEN.csv; dans un second temps, lire NOUVEAU.csv et tester
   pour chaque ligne si la clé est déjà utilisée.

2. Avec un script shell utilisant grep -f. Dans un premier temps, en
   lisant ANCIEN.csv, stocker la liste des identifiants à rejeter dans
   un fichier FILE. Dans un second temps, un truc du style:

 grep -v -f FILE NOUVEAU.csv

   (pas testé). Dans la liste de rejet, il faut faire attention sur
   les regexp, au cas une adresse mail peut avoir des caractères
   spéciaux, si une adresse mail peut être une sous-chaîne d'une
   autre, ou si elle peut apparaître ailleurs dans la ligne (i.e.
   pas comme identifiant). Bref, la solution (1) me semble plus
   simple.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Re: Diff : obtenir uniquement les lignes ajoutées

2017-09-20 Thread Yves Rutschle
On Wed, Sep 20, 2017 at 04:48:43PM +0200, Migrec wrote:
> J'ai un fichier CSV avec des identifiants, des mots de passes et quelques
> autres données.

C'est mal, il faut hacher les mots de passe.

> J'aimerai extraire les lignes ajoutées au fichier ANCIEN.csv par rapport au
> fichier NOUVEAU.csv. Certains lignes ont été modifiées et celles-ci ne
> m'intéressent pas. À noter que j'ai une adresse mail dans chaque ligne qui
> pourrait servir d'identifiant unique...

En Perl, avec un tableau associatif indexé par adresse mail,
par ex. avec des fichiers:

toto:tata:f...@bar.com:0:2


# Lire et indexer le premier fichier
my %lines;
foreach (<$file1>) {
   my ($f1, $f2, $email, $f3, $f4) = split /:/;
   $lines{$email} = 1;
}

# Imprimer ce qui n'est pas dans le premier fichier
foreach (<$file2>) {
   my ($f1, $f2, $email, $f3, $f4) = split /:/;
   print unless exists $lines{$email};
}


Pas testé!
Y.



Diff : obtenir uniquement les lignes ajoutées

2017-09-20 Thread Migrec

Bonjour,

J'ai un fichier CSV avec des identifiants, des mots de passes et 
quelques autres données.
J'aimerai extraire les lignes ajoutées au fichier ANCIEN.csv par rapport 
au fichier NOUVEAU.csv. Certains lignes ont été modifiées et celles-ci 
ne m'intéressent pas. À noter que j'ai une adresse mail dans chaque 
ligne qui pourrait servir d'identifiant unique...


Comment feriez-vous ?

--
Migrec



Re: faire un diff en supprimant les doublons

2017-08-29 Thread Yves Rutschle
On Tue, Aug 29, 2017 at 11:01:02AM +0200, bernard.schoenac...@free.fr wrote:
> j'ai un trou de mémoire et cf sujet

diff | uniq?

Y.



Re: faire un diff en supprimant les doublons

2017-08-29 Thread Francois Lafont
On 08/29/2017 11:16 AM, Jean-Marc wrote:
 
> J'espère que c'est dans la bonne direction.
> Difficile avec si peu d'info.

Oui, et c'est un peu une habitude du PO je trouve.

-- 
François Lafont



Re: faire un diff en supprimant les doublons

2017-08-29 Thread bernard . schoenacker


- Mail original -
> De: "Jean-Marc" <jean-m...@6jf.be>
> À: debian-user-french@lists.debian.org
> Envoyé: Mardi 29 Août 2017 11:16:15
> Objet: Re: faire un diff en supprimant les doublons
> 
> Tue, 29 Aug 2017 11:01:02 +0200 (CEST)
> bernard.schoenac...@free.fr écrivait :
> 
> > bonjour,
> 
> salut Bernard,
> 
> > 
> > j'ai un trou de mémoire et cf sujet
> 
> Quelque chose comme la commande  ?
> 
> > 
> > merci d'avance pour le coup de pouce
> 
> J'espère que c'est dans la bonne direction.
> Difficile avec si peu d'info.
> À moins que ce soit pour un jeu de devinettes.
> :-)
> 
> > 
> > slt
> 
> Bonne journée.
> 
> > bernard
> > 
> 
> 
> Jean-Marc <jean-m...@6jf.be>


bonjour,
voici une solution :

sort file1 file2 | uniq -d

j'avais souvenir de pouvoir faire un diff de fichier avec l'option duplicate
afin de supprimer les doublons ...

merci

slt
bernard



Re: faire un diff en supprimant les doublons

2017-08-29 Thread Jean-Marc
Tue, 29 Aug 2017 11:01:02 +0200 (CEST)
bernard.schoenac...@free.fr écrivait :

> bonjour,

salut Bernard,

> 
> j'ai un trou de mémoire et cf sujet

Quelque chose comme la commande  ?

> 
> merci d'avance pour le coup de pouce

J'espère que c'est dans la bonne direction.
Difficile avec si peu d'info.
À moins que ce soit pour un jeu de devinettes.
:-)

> 
> slt

Bonne journée.

> bernard
> 


Jean-Marc 


pgpgMAFohOR53.pgp
Description: PGP signature


Re: faire un diff en supprimant les doublons

2017-08-29 Thread Pierre Meurisse
On Tue, Aug 29, 2017 at 11:01:02AM +0200, bernard.schoenac...@free.fr wrote:
> bonjour,
> 
> j'ai un trou de mémoire et cf sujet
> 
> merci d'avance pour le coup de pouce
> 
> slt
> bernard
> 

fdupes ?

-- 
Pierre Meurisse



faire un diff en supprimant les doublons

2017-08-29 Thread bernard . schoenacker
bonjour,

j'ai un trou de mémoire et cf sujet

merci d'avance pour le coup de pouce

slt
bernard



Re: tar diff et probleme

2015-03-10 Thread Samuel

Le 10/03/2015 09:00, Stephane Ascoet a écrit :

Le 05/03/2015 09:48, Samuel a écrit :

je sors bien du fichier avant de faire le tar, donc à priori pas de
fichier temporaire.


Bonjour, il est aussi possible d'ouvrir le fichier en ecriture, mais 
sans fichier d'echange avec l'option -n, ou de retarder la creation de 
celui-ci(voir par exemple 
http://www.fdn.fr/~sascoet/texte/fichiersdeconfiguration/vimrc


Je garde cette option -n sous le coude ... et merci pour le lien.

Samuel.

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54ff4637.30...@ingescom.com



Re: tar diff et probleme

2015-03-10 Thread Stephane Ascoet

Le 05/03/2015 09:48, Samuel a écrit :

je sors bien du fichier avant de faire le tar, donc à priori pas de
fichier temporaire.


Bonjour, il est aussi possible d'ouvrir le fichier en ecriture, mais 
sans fichier d'echange avec l'option -n, ou de retarder la creation de 
celui-ci(voir par exemple 
http://www.fdn.fr/~sascoet/texte/fichiersdeconfiguration/vimrc

--
Bien cordialement, Stephane Ascoet


--
Ce message a ete verifie par MailScanner
pour des virus ou des polluriels et rien de
suspect n'a ete trouve.

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54fea48f.1050...@univ-paris1.fr



Re: tar diff et probleme

2015-03-09 Thread Vincent Lefevre
On 2015-03-06 17:40:53 +0100, Sylvain L. Sauvage wrote:
 Le vendredi 6 mars 2015, 17:07:32 Vincent Lefevre a écrit :
  On 2015-03-05 21:01:52 +0100, Sylvain L. Sauvage wrote:
   Le jeudi 5 mars 2015, 20:10:08 Vincent Lefevre a écrit :
   (…]
   Note : les fichiers ~ ne sont pas des fichiers
 « temporaires », ce sont des fichiers « de sauvegarde ».

Ils sont temporaires: ils disparaissent quand tu quittes
l'éditeur.

 Non, pas les ~ d’Emacs.
  
  Je ne parlais pas des ~ d'Emacs
 
   Alors ne dis pas « Ils » juste sous ma phrase « les fichiers 
 ~ »…

Oui, j'avais répondu un peu trop rapidement.

Note que si un fichier ~ (de sauvegarde) est créé, cela implique
normalement que le véritable fichier a aussi été modifié sur
disque, donc que le mtime a été modifié que ces fichiers de
sauvegarde existent ou non. Donc ces fichiers de sauvegarde
ne sont de toute façon pas la cause première de la modification
du mtime (s'il n'y en avait pas, ce serait pareil).

  qui ne sont *pas* créés tant
  que tu ne sauves pas le fichier (ce qui est le cas de l'OP).
  Emacs crée des #fichier# pour ses sauvegardes *temporaires*
 
   .#fichier#, ils sont cachés.
 
   Et ils ne sont pas créés si on ne fait que lire le fichier, 
 contrairement aux .swp de vi.

Mais si en lisant le fichier, on modifie le buffer accidentellement
(juste le buffer, sans sauver les modifications), un tel fichier peut
tout de même être créé. Pour la lecture uniquement, il vaut donc mieux
ouvrir le fichier en read-only.

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: https://www.vinc17.net/
100% accessible validated (X)HTML - Blog: https://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/20150309111048.gd26...@xvii.vinc17.org



Re: tar diff et probleme

2015-03-09 Thread Samuel

Bonjour,

Le 08/03/2015 18:09, mrr a écrit :

On 03/07/2015 11:40 AM, Samuel wrote:

Je cherche à synchroniser un dossier imap, mais que les fichiers
supprimés aillent dans un autre dossier ... mais pour l'instant je n'ai
trouvé cette fonction que dans des sauvegardes incrémentielles, ce qui
ne me convient pas tout à fait (je veux garder un dossier image unique).


J'ai vu dans ton prochain message que tu as trouvé une solution avec 
rsync, tant mieux, je voulais juste ajouter un petit commentaire.


Si tu est à l'aise avec bash, tu aurais pu créer un petit script qui, 
par exemple utilise find pour trouver les fichiers modifiés (si tu 
utilise atime, je conseillerais un 'relatime' plutôt que noatime dans 
fstab) etc.


En effet, il faut que je le change dans le fstab, même si dans mon cas, 
relatime n'est pas forcément nécessaire (pas de mutt ou autre).


Et concernant un find, je trouve quand même rsync plus facile à mettre 
en place (il fait presque tout ... tout seul)  sauf travailler sur 
des archives compressées.


[...]
PS: En passant je trouve ça que les fichiers supprimés aillent dans 
un autre dossier pas si clair! Tu veux réinventer la corbeille? : 


C'est pour un serveur de backup distant centralisé en mode console.

Merci.
Samuel.

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54fd59b0.2030...@ingescom.com



Re: tar diff et probleme

2015-03-08 Thread mrr

On 03/07/2015 11:40 AM, Samuel wrote:

Je cherche à synchroniser un dossier imap, mais que les fichiers
supprimés aillent dans un autre dossier ... mais pour l'instant je n'ai
trouvé cette fonction que dans des sauvegardes incrémentielles, ce qui
ne me convient pas tout à fait (je veux garder un dossier image unique).


J'ai vu dans ton prochain message que tu as trouvé une solution avec 
rsync, tant mieux, je voulais juste ajouter un petit commentaire.


Si tu est à l'aise avec bash, tu aurais pu créer un petit script qui, 
par exemple utilise find pour trouver les fichiers modifiés (si tu 
utilise atime, je conseillerais un 'relatime' plutôt que noatime dans 
fstab) etc.


Bon, vu que j'écris pour rien j'arrête ici.
Oublie pas git si t'as le temps.

PS: En passant je trouve ça que les fichiers supprimés aillent dans un 
autre dossier pas si clair! Tu veux réinventer la corbeille? :)


--
mrr

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54fc7459$0$3348$426a7...@news.free.fr



Re: tar diff et probleme

2015-03-07 Thread Samuel

Le 07/03/2015 11:36, Samuel a écrit :

[...]

Le 06/03/2015 14:33, mrr a écrit :
Si ton but c'est de faire un backup uniquement des fichiers modifiés 
tu as bien sûr (le presque incontournable) rsync et companie 


Justement je suis en train de tester, mais je n'arrive pas encore à 
faire ce que je veux (la fonction --backup ne me convient pas tout à 
fait)


Je cherche à synchroniser un dossier imap, mais que les fichiers 
supprimés aillent dans un autre dossier ... mais pour l'instant je 
n'ai trouvé cette fonction que dans des sauvegardes incrémentielles, 
ce qui ne me convient pas tout à fait (je veux garder un dossier image 
unique).


J'avais essayé trop rapidement, rsync correspond parfaitement à mes besoins.

Merci.
Samuel.

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54fb5507.4050...@ingescom.com



Re: tar diff et probleme

2015-03-07 Thread Samuel

Le 06/03/2015 14:33, mrr a écrit :

On 03/05/2015 01:30 PM, Samuel wrote:


Non, une fois décompressés un diff -r ne donne aucune différence sur les
2 dossiers (/etc concerné dans l'exemple).



Ben justement, au lieu de faire un diff sur 2 fichiers binaires 
pourquoi tu ferais pas un diff sur le contenu genre:


~$ tar tf test1.tar  liste_fichiers_de_test1
~$ tar tf test2.tar  liste_fichiers_de_test2
~$ diff liste_fichiers_de_test?
~$ rm liste_fichiers_de_test?

Et y'a moyen de mettre tout ça sur une seule ligne si tu préfères (ou 
si tu n'as pas envie de créer des fichiers temporaires.


Je précise que vim travaille sur un fichier temporaire (par sécurité) 
et lorsque tu lances la commande d'écriture il détruit l'ancien 
fichier et en recrée un autre (lance des :w, l'inode de ton fichier 
changera à chaque fois). Donc si tu veux qu'il n'y ait pas de 
différence en cas d'écriture (en fait je m'écarte car ce n'est pas ton 
cas de figure mais bon je termine ma phrase qd-même), ce n'est pas 
seulement le atime qu'il faudra préserver mais aussi le ctime (le 
fichier étant donc créé à chaque écriture).


Il faut savoir se relire : Si tu veux pas de différence en cas 
d'écriture. :) C'est malin comme phrase, ça.


Bon je parlais de vi et inode parce qu'on en parlait récemment sur un 
des groupes linux et c'est encore (pour l'instant) dans ma mémoire.


(Presque) dernière idée, peux-tu te permettre de time-stamper tous 
les fichiers de l'archive à une même date arbitraire lors de chaque 
archivage?


J'ai résolu provisoirement le problème en déplaçant les fichiers temp de 
vim dans /tmp (même si ça peut créer d'autres problèmes ...)



Git, c'est une excellente occasion d'apprendre à s'en servir.

Si ton but c'est de faire un backup uniquement des fichiers modifiés 
tu as bien sûr (le presque incontournable) rsync et companie 


Justement je suis en train de tester, mais je n'arrive pas encore à 
faire ce que je veux (la fonction --backup ne me convient pas tout à fait)


Je cherche à synchroniser un dossier imap, mais que les fichiers 
supprimés aillent dans un autre dossier ... mais pour l'instant je n'ai 
trouvé cette fonction que dans des sauvegardes incrémentielles, ce qui 
ne me convient pas tout à fait (je veux garder un dossier image unique).


Je vais essayer de voir dans les options d'imapsync, même si je préfère 
une solution à base de ssh.


Merci.
Samuel.

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54fad4b2.2020...@ingescom.com



Re: tar diff et probleme

2015-03-06 Thread mrr

On 03/05/2015 01:30 PM, Samuel wrote:


Non, une fois décompressés un diff -r ne donne aucune différence sur les
2 dossiers (/etc concerné dans l'exemple).



Ben justement, au lieu de faire un diff sur 2 fichiers binaires pourquoi 
tu ferais pas un diff sur le contenu genre:


~$ tar tf test1.tar  liste_fichiers_de_test1
~$ tar tf test2.tar  liste_fichiers_de_test2
~$ diff liste_fichiers_de_test?
~$ rm liste_fichiers_de_test?

Et y'a moyen de mettre tout ça sur une seule ligne si tu préfères (ou si 
tu n'as pas envie de créer des fichiers temporaires.


Je précise que vim travaille sur un fichier temporaire (par sécurité) et 
lorsque tu lances la commande d'écriture il détruit l'ancien fichier et 
en recrée un autre (lance des :w, l'inode de ton fichier changera à 
chaque fois). Donc si tu veux qu'il n'y ait pas de différence en cas 
d'écriture (en fait je m'écarte car ce n'est pas ton cas de figure mais 
bon je termine ma phrase qd-même), ce n'est pas seulement le atime qu'il 
faudra préserver mais aussi le ctime (le fichier étant donc créé à 
chaque écriture).


Il faut savoir se relire : Si tu veux pas de différence en cas 
d'écriture. :) C'est malin comme phrase, ça.


Bon je parlais de vi et inode parce qu'on en parlait récemment sur un 
des groupes linux et c'est encore (pour l'instant) dans ma mémoire.


(Presque) dernière idée, peux-tu te permettre de time-stamper tous les 
fichiers de l'archive à une même date arbitraire lors de chaque archivage?


Git, c'est une excellente occasion d'apprendre à s'en servir.

Si ton but c'est de faire un backup uniquement des fichiers modifiés tu 
as bien sûr (le presque incontournable) rsync et companie.


--
mrr

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54f99eb6$0$3307$426a7...@news.free.fr



Re: tar diff et probleme

2015-03-06 Thread Vincent Lefevre
On 2015-03-05 21:01:52 +0100, Sylvain L. Sauvage wrote:
 Le jeudi 5 mars 2015, 20:10:08 Vincent Lefevre a écrit :
 (…]
 Note : les fichiers ~ ne sont pas des fichiers
   « temporaires », ce sont des fichiers « de sauvegarde ».
  
  Ils sont temporaires: ils disparaissent quand tu quittes
  l'éditeur.
 
   Non, pas les ~ d’Emacs.

Je ne parlais pas des ~ d'Emacs qui ne sont *pas* créés tant que
tu ne sauves pas le fichier (ce qui est le cas de l'OP). Emacs
crée des #fichier# pour ses sauvegardes *temporaires* des fichiers
modifiés mais pas encore sauvés. Ces fichiers dispassaissent
normalement, mais il peut en rester si Emacs n'a pas terminé
proprement. Un locate \# permet de voir ce qui traîne.

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: https://www.vinc17.net/
100% accessible validated (X)HTML - Blog: https://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/20150306160732.gc10...@ypig.lip.ens-lyon.fr



Re: tar diff et probleme

2015-03-06 Thread Sylvain L. Sauvage
Le vendredi 6 mars 2015, 17:07:32 Vincent Lefevre a écrit :
 On 2015-03-05 21:01:52 +0100, Sylvain L. Sauvage wrote:
  Le jeudi 5 mars 2015, 20:10:08 Vincent Lefevre a écrit :
  (…]
  Note : les fichiers ~ ne sont pas des fichiers
« temporaires », ce sont des fichiers « de sauvegarde ».
   
   Ils sont temporaires: ils disparaissent quand tu quittes
   l'éditeur.
   
Non, pas les ~ d’Emacs.
 
 Je ne parlais pas des ~ d'Emacs

  Alors ne dis pas « Ils » juste sous ma phrase « les fichiers 
~ »…

 qui ne sont *pas* créés tant
 que tu ne sauves pas le fichier (ce qui est le cas de l'OP).
 Emacs crée des #fichier# pour ses sauvegardes *temporaires*

  .#fichier#, ils sont cachés.

  Et ils ne sont pas créés si on ne fait que lire le fichier, 
contrairement aux .swp de vi.

 des fichiers modifiés mais pas encore sauvés. Ces fichiers
 dispassaissent normalement, mais il peut en rester si Emacs
 n'a pas terminé proprement. Un locate \# permet de voir ce
 qui traîne.

-- 
 Sylvain Sauvage

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/7042631.7y0sXKMxlf@earendil



Re: tar diff et probleme

2015-03-05 Thread Sylvain L. Sauvage
Le jeudi 5 mars 2015, 20:10:08 Vincent Lefevre a écrit :
(…]
Note : les fichiers ~ ne sont pas des fichiers
  « temporaires », ce sont des fichiers « de sauvegarde ».
 
 Ils sont temporaires: ils disparaissent quand tu quittes
 l'éditeur.

  Non, pas les ~ d’Emacs.

-- 
 Sylvain Sauvage

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/22276811.D8AGAEuZqA@earendil



Re: tar diff et probleme

2015-03-05 Thread Samuel

Le 05/03/2015 17:02, Sébastien NOBILI a écrit :

Le jeudi 05 mars 2015 à 16:52, Samuel a écrit :

¹  Faut utiliser un vrai éditeur de texte ! ;oP

Et tu conseilles quoi ? (et qui ne change pas le mtime ...
comme ça je garde mon long script écrit à la sueur de mon
front ;-) )

   N’importe quoi sauf vi ?

   J’aime bien joe (avatar jmacs) mais je préfère emacsclient -t.
(Oui, bon, c’était pas déjà évident que j’étais emacsien ?)
Réellement, je ne connais pas beaucoup d’éditeurs qui écrivent
dans le répertoire courant quand il n’y a rien à écrire…

J'ai lu le lien wikipedia donné dans une autre réponse de ce fil. Je vois que 
la question reste ouverte 
Je vais donc en tester un ou deux, mais c'est vrai que vi me convient bien 
globalement.

La question n'est pas prête d'être fermée…

Pour être plus objectif que dans ma précédente intervention, le meilleur éditeur
de texte est celui avec lequel tu es à l'aise.

Sébastien


J'ai l'impression en effet que tout tourne autour des habitudes des 
utilisateurs.

Mais je vais quand même en essayer d'autres pour voir.

Merci.
Samuel.

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54f88408.3060...@ingescom.com



Re: tar diff et probleme

2015-03-05 Thread Sylvain L. Sauvage
Le jeudi 5 mars 2015, 17:11:14 Yves Rutschle a écrit :
 On Thu, Mar 05, 2015 at 04:37:43PM +0100, Sylvain L. Sauvage 
wrote:
  Réellement, je ne connais pas beaucoup d'éditeurs qui
  écrivent dans le répertoire courant quand il n'y a rien à
  écrire...
 Je suis surpris qu'Emacs ne crée pas de fichier
 temporaire...

  Préjugés… ;o)

 Pour vim, il suffit de dire qu'on veut
 ouvrir le fichier en lecture seule:
 
 vim -R /etc/crontab
 view /etc/crontab

  C’est quand même con qu’il tripote le répertoire quand il n’y 
en pas besoin…

-- 
 Sylvain Sauvage

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/1673285.5eVh6b772R@earendil



Re: tar diff et probleme

2015-03-05 Thread Sylvain L. Sauvage
Le jeudi 5 mars 2015, 18:18:29 Vincent Lefevre a écrit :
[…]
 Emacs crée aussi un fichier temporaire, mais seulement si tu
 tentes de modifier le fichier je crois bien.

  Note : les fichiers ~ ne sont pas des fichiers 
« temporaires », ce sont des fichiers « de sauvegarde ».
  Il semblerait (je ne sais pas, j’ai pas de vi d’installé ;o) 
que le cas ici soit que vi crée un fichier « temporaire » quand 
il en ouvre un autre. Peut-être que ce fichier va servir de 
« sauvegarde » et rester s’il y a des modifs mais le 
comportement dans le cas d’une simple lecture est celui d’un 
« temporaire » puisqu’il est effacé par vi lui-même.

  Emacs (nano, joe, zile…) en crée(nt) seulement au moment d’une 
sauvegarde.  Et ces éditeurs (sauf peut-être nano ?) ne 
sauvegardent vraiment que s’il y a eu modification ou si on 
change le nom du fichier (qui est une façon de le forcer à 
sauvegarder).

  Avec Emacs et joe (à vérifier pour les autres), on peut 
empêcher ces fichiers de sauvegarde. On peut changer leur nom (→ 
.bak p.ex.).

  (Et Emacs sait que, si un fichier est dans un gestionnaire de 
version, le ~ est inutile. ’fin, ça doit être git-el qui le 
sait…)

-- 
 Sylvain Sauvage

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/14401803.PE50sqQpRM@earendil



Re: tar diff et probleme

2015-03-05 Thread Samuel

Le 05/03/2015 18:18, Vincent Lefevre a écrit :

On 2015-03-05 16:56:23 +0100, Samuel wrote:

Je vais regarder un peu dans tout ce qui a été cité, dont emacs (si c'est en
console), mais c'est vrai que je suis habitué à vi.

Emacs crée aussi un fichier temporaire, mais seulement si tu tentes
de modifier le fichier je crois bien.


J'ai résolu provisoirement le problème en déplaçant fichiers de backup 
et de swap de vim dans /tmp


En attendant de mettre en place une solution de backup digne de ce nom.

Merci.
Samuel.

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: https://lists.debian.org/54f898b0.7010...@ingescom.com



  1   2   3   4   5   6   >