All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Walberg <twalberg@mindspring.com>
To: "Sadanapalli, Pradeep Kumar (MED, TCS)" <Pradeep.Sadanapalli@med.ge.com>
Cc: linux-admin@vger.kernel.org
Subject: Re: To extract a particular line(given by line number)  from a file
Date: Fri, 28 Mar 2003 13:15:15 -0600	[thread overview]
Message-ID: <20030328131515.C9113@mindspring.com> (raw)
In-Reply-To: <2DE78F33FFE0D3118C0200508B94F9CA19420E8C@uswaumsx08medge.med.ge.com> from Sadanapalli, Pradeep Kumar (MED, TCS) on 03/28/2003 12:35

[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]

tail +5 somefile | head -1

or

cat -n somefile | grep '  *5 '

or

sed -ne 5p somefile

or

...


On 03/28/2003 12:35 -0600, Sadanapalli, Pradeep Kumar (MED, TCS) wrote:
>>	Hi Friends,
>>	I am running RedHat Linux 8.0. I want to do the following .
>>	
>>	I have a file with several lines of data in it. I want to extract a line
>>	I want from the file
>>	and display the whole line of data. 'grep' searches only for patterns,as
>>	I believe. I don't want to search for patterns. 
>>	I just directly want to extract the data by line numbers.For example, I
>>	want to get the data in line number 5.
>>	
>>	How can I do this? Is there any command to do this? Please help me. I
>>	hope I am clear.
>>	
>>	Thanks,
>>	Pradeep
>>	-
>>	To unsubscribe from this list: send the line "unsubscribe linux-admin" in
>>	the body of a message to majordomo@vger.kernel.org
>>	More majordomo info at  http://vger.kernel.org/majordomo-info.html
End of included message



-- 
+--------------------------+------------------------------+
| Tim Walberg              | twalberg@mindspring.com      |
| 830 Carriage Dr.         | www.mindspring.com/~twalberg |
| Algonquin, IL 60102      |                              |
+--------------------------+------------------------------+

[-- Attachment #2: Type: application/pgp-signature, Size: 174 bytes --]

  reply	other threads:[~2003-03-28 19:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-28 18:35 To extract a particular line(given by line number) from a file Sadanapalli, Pradeep Kumar (MED, TCS)
2003-03-28 19:15 ` Tim Walberg [this message]
2003-03-28 19:26 ` Ashish V. Orpe
  -- strict thread matches above, loose matches on Subject: below --
2003-03-28 19:20 jbrown105

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030328131515.C9113@mindspring.com \
    --to=twalberg@mindspring.com \
    --cc=Pradeep.Sadanapalli@med.ge.com \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.