I thought everything is described in sufficient detail in the documentation and project's README ... Obviously it is not so clear, my fault, sorry. Probably I should consider adding more explanation to README.md. But I thought that merge-sorting and binary-search are well-known algorithms, and we all know exactly how to do such operations in memory, so we know some use cases.
It is a java/kotlin library, so you can use it from any environment, not only linux. for example android, with limited disk-space and memory. When you have a limitation of memory you can't use just `java.util.Arrays.sort`. And writing a code which will call linux utility requires some coding, and investigation too. As for me, it is good to have java utility for such a purpose. I can't run testcontainers every time I need to just sort a file. Also, I'm not sure that linux-utilities provide a way to sort something with an arbitrary comparator. Maybe yes, but in this case you have to spend time to find the right parameter. As for usage. It can be used to sort csv, or some "broken" csv where there is a delimiter between rows, but each row contains a different number of words. Off course, It can be used for sorting any file which has some delimiter. It can be used to create some indexed files. Probably we can use some frameworks or databases for it. But sometimes we don't want to mess with heavy dependencies for the sake of a few lines of code. We use this library as a second-level cache when parsing CIMXML RDF, this file-based cache contains triples, and also subject-type pairs (RDF nodes). It is not csv. Also, I'm thinking about RDF-Graph implementation backed by fs. So, I think we can always find ways to use this functionality. Placing it in some common place would save other developers time. Implementation of file-sorting and searching is not so simple as it sounds. You have to think about memory and performance, and, maybe, about diskspace. The library uses java NIO and coroutines. It is dealing with ByteArrays, ByteBuffers, indexes. It is easy to make mistakes. Some developers may think that this is easy, after trying to write simply, they may realize that it is not worth wasting time on this, and eventually come to some kind of compromise solution, for example, calling a Linux utility On Tue, Jul 18, 2023 at 7:25 PM Gilles Sadowski <gillese...@gmail.com> wrote: > Hello. > > Le mar. 18 juil. 2023 à 17:35, ssz <sss.z...@gmail.com> a écrit : > > > > here > https://github.com/sszuev/textfile-utils-examples/tree/master/src/test > > Yes, this shows the API and its usage, but I was also wondering > about actual uses. What kind of applications would need to call > this functionality from Java? What does your implementation bring > which a user cannot do with "sort"?[1] > > Best regards, > Gilles > > [1] https://en.wikipedia.org/wiki/Sort_(Unix) > > > > > On Tue, Jul 18, 2023 at 12:03 PM Gilles Sadowski <gillese...@gmail.com> > > wrote: > > > > > Hello. > > > > > > Le mar. 18 juil. 2023 à 10:50, ssz <sss.z...@gmail.com> a écrit : > > > > > > > > Hello there > > > > > > > > I see this issue on hold. > > > > So far, no one else has an opinion on this issue. > > > > > > Maybe "Commons Text"? > > > It would help to see use-cases and API examples (in Java). > > > > > > Regards, > > > Gilles > > > > > > > I'm going to unsubscribe from this list for a while. > > > > Please email me directly in case of a positive final decision. > > > > > > > > sss.zuev {at} gmail / com > > > > > > > >>> [...] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > >