unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* remove duplicates lines in a buffer
@ 2022-12-22 18:59 GH
  2022-12-22 19:08 ` Emanuel Berg
  2022-12-22 19:23 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: GH @ 2022-12-22 18:59 UTC (permalink / raw)
  To: Help GNU Emacs


A program give me huge logs with duplicated lines
I _need_ to simplify this huge file removing duplicated lines.

any tool to do it? maybe a func?

I think in a function that do a list with lines maybe using

  (push (NEWELT PLACE)) ...

in a while cycle

but dont push a line if it exist in the list, maybe checking it with

    (dolist ...)

then to write the list in a new buffer



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remove duplicates lines in a buffer
  2022-12-22 18:59 remove duplicates lines in a buffer GH
@ 2022-12-22 19:08 ` Emanuel Berg
  2022-12-22 19:23 ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Emanuel Berg @ 2022-12-22 19:08 UTC (permalink / raw)
  To: help-gnu-emacs

GH wrote:

> A program give me huge logs with duplicated lines I _need_
> to simplify this huge file removing duplicated lines.

Linux shell,

  $ sort $log | uniq

see sort(1) and uniq(1).

Emacs:

  `cl-remove-duplicates'

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remove duplicates lines in a buffer
  2022-12-22 18:59 remove duplicates lines in a buffer GH
  2022-12-22 19:08 ` Emanuel Berg
@ 2022-12-22 19:23 ` Eli Zaretskii
  2022-12-24 15:55   ` Tim Landscheidt
  1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2022-12-22 19:23 UTC (permalink / raw)
  To: help-gnu-emacs

> From: GH <project@gnuhacker.org>
> Date: Thu, 22 Dec 2022 19:59:45 +0100
> 
> 
> A program give me huge logs with duplicated lines
> I _need_ to simplify this huge file removing duplicated lines.
> 
> any tool to do it? maybe a func?

There's already a command delete-duplicate-lines in Emacs.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: remove duplicates lines in a buffer
  2022-12-22 19:23 ` Eli Zaretskii
@ 2022-12-24 15:55   ` Tim Landscheidt
  0 siblings, 0 replies; 4+ messages in thread
From: Tim Landscheidt @ 2022-12-24 15:55 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> wrote:

>> A program give me huge logs with duplicated lines
>> I _need_ to simplify this huge file removing duplicated lines.

>> any tool to do it? maybe a func?

> There's already a command delete-duplicate-lines in Emacs.

Of course there is.  For more than eight years!  And until
today I always resorted to query-replace-regexp.

Thanks,
Tim




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-24 15:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-22 18:59 remove duplicates lines in a buffer GH
2022-12-22 19:08 ` Emanuel Berg
2022-12-22 19:23 ` Eli Zaretskii
2022-12-24 15:55   ` Tim Landscheidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).