Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Limits on file numbers in sort -m
- Date: Thu, 29 May 2014 11:21:19 +0200
- From: Bruno Raoult <braoult@example.com>
- Subject: Re: [tlug] Limits on file numbers in sort -m
- References: <CABHGxq7jYkDDLkF8uzzNK8WeU+37t1wgpVhk6VD2HQKyEi7wBw@mail.gmail.com> <CAJMSLH618MfmhL9ufAOfLXxw52i4STpF8dsc_+xe-2GRB3JM8g@mail.gmail.com> <87bnui8sky.fsf@uwakimon.sk.tsukuba.ac.jp> <CABHGxq4NEBMVR8jndiEvcgsGkc_B0f-qcrs2sFjqaAdWH3n9sw@mail.gmail.com> <CAJMSLH6SdSUmvHsjmZBZP-g1graNuPV51vdwLzpPf7ipmz7+zA@mail.gmail.com> <CABHGxq7eCk9Pk1JtNrZuqK_8yv4bt7ftoWwyXqf5P+GKYQH=5w@mail.gmail.com>
On Thu, May 29, 2014 at 7:32 AM, Jim Breen <jimbreen@example.com> wrote:I don't understand how you get 2 lines with uniq -c.
> Regarding the count of occurrences you could pipe the "sort -m ...." intoIn any case the output from "uniq -c" is not what I want, so since I'd need to
> "uniq -c". I've always been annoyed by the format of uniq (a space-padded,
> fixed-width count as the first column) but if you can live with that you'll
> be getting to what you want quicker. The pipe to uniq will consume it's
> input buffer very quickly so it's not going to be the case that all of the
> output of sort must stay in memory as long as the process is running. Also
> if duplicates are common, your final output file saved to disk will be
> usefully smaller.
reformat it it's easier to use my own utility. It also give me the
option of turning
this 3
this 4
into
this 7
which I can't do with "uniq -c".If you pipe the output of sort -m, you will get one line only (your "this 7").
br@lorien:/export/home/br$ cat x
a
a a
c
d
br@lorien:/export/home/br$ cat y
a
a a
b
c
br@lorien:/export/home/br$ sort -m x y | uniq -c
2 a
2 a a
1 b
2 c
1 d
br@lorien:/export/home/br$ sort -m x y | uniq -c | sed -e 's/^[ ]*//' -e 's/ /,/'
2,a
2,a a
1,b
2,c
1,dThe last command is to get a csv (if the filename contains special characters, such as comma or double quotes, they should be handled differently, but this could be enough if your filenames are not in this case).br.
--
2 + 2 = 5, for very large values of 2.
- References:
- [tlug] Limits on file numbers in sort -m
- From: Jim Breen
- Re: [tlug] Limits on file numbers in sort -m
- From: 黒鉄章
- Re: [tlug] Limits on file numbers in sort -m
- From: Stephen J. Turnbull
- Re: [tlug] Limits on file numbers in sort -m
- From: Jim Breen
- Re: [tlug] Limits on file numbers in sort -m
- From: 黒鉄章
- Re: [tlug] Limits on file numbers in sort -m
- From: Jim Breen
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Limits on file numbers in sort -m
- Next by Date: Re: [tlug] Limits on file numbers in sort -m
- Previous by thread: Re: [tlug] Limits on file numbers in sort -m
- Next by thread: Re: [tlug] Limits on file numbers in sort -m
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links