Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Mark D. Stock — — source: Informix-list mailing list archive (1991-1998)
Prasad Mahale wrote:
>
> Hi All,
> How can i get nth line (for example say 100th line) from a text file
> directly?
> I don't want to scan whole file for that using a loop.
> Like TOP and TAIL command, is there anything to read a range of lines
> in-between?
How about:
head -100 myfile |tail -1
I don't THINK head scans beyond the required lines.
If you wanted a range of lines, say 90-100, then obviously:
head -100 myfile |tail -10
Did I stray into c.u.s instead of c.d.i? :-)
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@mydas.freeserve.co.uk |//////// /|
| http://www.informix.comhttp://www.informixhandbook.com |///// / //|
| http://www.iiug.org +-----------------------------------+//// / ///|
| |This email will self-destruct in |/// / ////|
| |10 sec. If you received this email |// / /////|
| |in error, sorry about the mess. |/ ////////|
+----------------------+-----------------------------------+-----------+
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.