I don't get this. Look at this.

OK When I run wc -l on file it must have got cached and the machine has 256M of 
RAM but still I would say that was fast enough by any standards.

11K line is no big deal. I have run grep queries on 85MB cobol source dump in 
around 20sec when I was working on a performance tuning project. That was a 
Pentium 200 with 32MB RAM.(OK I got the system administrator off GNOME first but 
that' a different story...)

And please, set some wrapping in your mail client. Poor souls like us can not 
read this.

  Shridhar
-------------------------------------------------------------------------------
[shridhar@perth Cdna]$ ls -al
total 48115
drwxr-xr-x    3 mushtaq  cvs           296 Sep 29 16:21 ./
drwxrwxr-x    9 shridhar cvs          1064 Sep 27 11:13 ../
-rw-r--r--    1 mushtaq  cvs           166 Sep 25 14:09 conformdb.log
-rw-r--r--    1 mushtaq  cvs       2665232 Sep 25 14:09 conformdb.nhr
-rw-r--r--    1 mushtaq  cvs        287212 Sep 25 14:09 conformdb.nin
-rw-r--r--    1 mushtaq  cvs       1126372 Sep 25 14:09 conformdb.nsd
-rw-r--r--    1 mushtaq  cvs         23637 Sep 25 14:09 conformdb.nsi
-rw-r--r--    1 mushtaq  cvs       8407606 Sep 25 14:09 conformdb.nsq
-r--r--r--    1 mushtaq  cvs      36744512 Sep 25 14:05 ensembl.cdna
drwxr-xr-x    2 mushtaq  cvs           656 Sep 27 13:57 Genes/
[shridhar@perth Cdna]$ file ensembl.cdna
ensembl.cdna: ASCII text
[shridhar@perth Cdna]$ wc -l ensembl.cdna
  594720 ensembl.cdna
[shridhar@perth Cdna]$ time head -300000 ensembl.cdna |tail -1
0.13user 0.20system 0:00.54elapsed 61%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (131major+23minor)pagefaults 0swaps
GGGGCTCCAGGCGCCCCTGTGATTACCTCCTACTGCCACCATGGCGCTCATTCAGATTCC
[shridhar@perth Cdna]$ free
              total       used       free     shared    buffers     cached
Mem:        255580     252048       3532        128      44768     173744
-/+ buffers/cache:      33536     222044
Swap:       401616        120     401496
[shridhar@perth Cdna]$
-------------------------------------------------------------------------------


Narayanamoorthy Srinivasan wrote:

> 
>   I wrote a shell script access a very big text file which happens to read the file 
>line by line.  When i use the command "head -$LINE_NO | tail -1" to retrieve a 
>particular line, the process becomes very slow when accessing a big file that 
>contains 11,000 lines.
>   Is any other solution for it.



_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to