Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-09-2008, 12:41 AM   #1
Registered: Mar 2008
Posts: 70

Rep: Reputation: 15
seperating substring

Dear ALL,

I have data in the file as follows

I want only first and last line of the file
and as

Please can any one help me to solve the issue.

With Regards,
Old 04-09-2008, 01:37 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
sed -n '1s/^[[:digit:]\.]*/./p;$s/^[[:digit:]]\.*/./p' testfile


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
php preg_replace substring of a substring senyahnoj Programming 5 12-08-2006 12:31 PM
to get a substring dimah Programming 1 06-22-2006 07:31 AM
Lua - seperating a string blackman890 Programming 13 03-28-2005 11:04 AM
Seperating IPTABLES Logs TheRealDeal Linux - Security 5 02-26-2005 09:51 AM
seperating values using perl pantera Programming 3 05-26-2004 01:31 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration