On 8/19/07, mano M <[EMAIL PROTECTED]> wrote:

>   I am using   shell command  to sort an input file in my c++ program.
>   system("sort -t',' -nk1,1 -nk2,2 -nk3,3)  ;
>
>   I would like to how much memory is reuiqred to sort a big file of 500 MB.

That depends on the shell command you are using, OS, etc (I am
guessing you are using Linux or some other Unix variant). A 500 MB
file is going to take a good bit of time to sort (the sort program
probably uses some intermediate files and doesn't do it all in memory,
you might want to take a look at the source code for it)

>   What would be the performance ?How can we calculate it?
>
>   Any other effient method is there?

This begs the question, of course, of why you are doing this with an
external command and not sorting the data yourself (in your
program).... or at least sorting it before you run your program (i.e.,
run both programs in a shell script).

-- 
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to