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: Fri, 30 May 2014 16:22:08 +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> <87sins7mhy.fsf@uwakimon.sk.tsukuba.ac.jp> <CAJA1Y2b6XyFNsFhDbK+ktgWk0cE5Lzfv9OrhimBH8RyN78yzLQ@mail.gmail.com> <87d2ew76yd.fsf@uwakimon.sk.tsukuba.ac.jp> <CAJA1Y2Y2vaH06nJyt25uREjCT9RELoTnfwDpeXX5Z97W45oZUQ@mail.gmail.com> <5387D422.2070302@extellisys.com> <CABHGxq65zdPuC1dRof0_KjmEzuNFX2GKS3JpjJM7T-U=2PH2Tw@mail.gmail.com>
On Fri, May 30, 2014 at 3:14 AM, Jim Breen <jimbreen@example.com> wrote:
On 30 May 2014 10:43, Travis Cardwell <travis.cardwell@example.com> wrote:Exactly, and since I'm aggregating counts, I can't use "uniq -c".
> The `sort -m` command does not sum counts, which is why Jim said that he
> will need to use external software to do so.
I'm building an n-gram corpus from a large text corpus. So as I
work through the text, I'm collecting things like the 4-gram:
これ は 何 です
As I'm merging and counting I'll have interim files such as;
file-n: これ は 何 です 19
file-m: これ は 何 です 27OK. I did not understand you needed to keep the interim counts (maybe for some other usage)...I thought you needed the final result only (with uniq being run at a final stage). If you don't, I am
not sure why the temp uniq is necessary (given disk space is not an issue).Also, and if I understood, the only issue is the number of possible opened files per process (especially
per user, and that you are not able to change the system limits for a specific user (=this is not your
machine)), right?
Or you have disk space limit, so you can't do simple things, such as using double space from original files.Or, you have time processing limit.
If you can break only one of these limits, solutions are possible:
- either on #files opened (sort | uniq will work)- either on disk space (no need to use uniq at temp stage, only at last one)- if you don't care CPU processing limit, a small script and a small DB can do everything (sqlite, etc...). It could be
expensive, but not so much, if the insert script makes a "+1" to a given key on insert, and real-time update disabled.
You will not even need to keep the original files sorted. You will get your output (key/number) immediately.
Instead of creating a new program, I would try everything else first, to be sure nothing is possible with existing commands...Just to avoid maintenance.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
- Re: [tlug] Limits on file numbers in sort -m
- From: Stephen J. Turnbull
- Re: [tlug] Limits on file numbers in sort -m
- From: Bruno Raoult
- Re: [tlug] Limits on file numbers in sort -m
- From: Stephen J. Turnbull
- Re: [tlug] Limits on file numbers in sort -m
- From: Bruno Raoult
- Re: [tlug] Limits on file numbers in sort -m
- From: Travis Cardwell
- 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
- 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