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.

TIA
Moorthy
On Wed, 07 Nov 2001 Shridhar Daithankar wrote :
> 
> 
> USM Bish wrote:
> 
> > The same is extrapolated for a specific  number of 
> lines from
> > a specific starting point. e.g. For  extracting  3 
> lines from 
> > lines 15 to 18 in textfile.txt, it would be:
> > 
> > $head -18 textfile.txt | tail -3
> 
> 
> Howabout writing a shell script for that?
> 
> #!/bin/bash
> head -$2 $1 | tail -$3
> 
>   Call this script say lines.sh.
> 
> Actually I think aliases is the better application but 
> never tried arguments in 
> aliases. So suggesting the script.
> 
>   Shridhar
> 
> 
> _______________________________________________
> linux-india-help mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/linux-india-
> -help
 


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

Reply via email to