The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk: need to extract a line before a pattern npn35 Shell Programming and Scripting 17 06-29-2008 07:38 PM
Extract Pattern Sequence jaganadh Shell Programming and Scripting 5 12-10-2007 08:06 AM
Extract if pattern matches Raynon Shell Programming and Scripting 20 10-29-2007 01:44 AM
Extract the Pattern aajan UNIX for Dummies Questions & Answers 6 08-08-2007 01:47 AM
Please help! Sed extract a pattern zhen Shell Programming and Scripting 11 09-18-2006 09:36 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-06-2008
Registered User
 

Join Date: Feb 2008
Posts: 5
extract a particular start and end pattern from a line

hi

In the foll example the whole text in a single line....

i want to extract text from IPTel to RTCPBase.h.
want to use this acrooss the whole file

Updated: IPTel\platform\core\include\RTCPBase.h \main\MWS2051_Sablime_Int\1 \main\MWS2051_Sablime_Int\IPT2_8_SP1_Integration\1

Thanks
Manish
Reply With Quote
Forum Sponsor
  #2  
Old 02-06-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,329
Code:
Echo 'Updated: IPTel\platform\core\include\RTCPBase.h \main\MWS2051_Sablime_Int\1 \main\MWS2051_Sablime_Int\IPT2_8_SP1_Integration\1' | awk '{print $2}'
Gives what you expect: IPTel\platform\core\include\RTCPBase.h

Regards
Reply With Quote
  #3  
Old 02-06-2008
Registered User
 

Join Date: Feb 2008
Posts: 5
Unhappy

it is showing only IPTel\platform
Reply With Quote
  #4  
Old 02-06-2008
Moderator
 

Join Date: Feb 2007
Posts: 2,329
Do you have a space after "IPTel\platform" ?

Regards
Reply With Quote
  #5  
Old 02-06-2008
Registered User
 

Join Date: Feb 2008
Posts: 5
Arrow

no there is no space....
can u try something else

i need the solution urgently.....

Thanks in advance
Reply With Quote
  #6  
Old 02-07-2008
Registered User
 

Join Date: Aug 2007
Posts: 16
cat <your file> | cut -d ' ' -f 1
Reply With Quote
  #7  
Old 02-07-2008
Registered User
 

Join Date: Nov 2005
Posts: 21
Quote:
Originally Posted by Franklin52 View Post
Code:
Echo 'Updated: IPTel\platform\core\include\RTCPBase.h \main\MWS2051_Sablime_Int\1 \main\MWS2051_Sablime_Int\IPT2_8_SP1_Integration\1' | awk '{print $2}'
Gives what you expect: IPTel\platform\core\include\RTCPBase.h

Regards
Echo 'Updated: IPTel\platform\core\include\RTCPBase.h \main\MWS2051_Sablime_Int\1 \main\MWS2051_Sablime_Int\IPT2_8_SP1_Integration\1' | awk -F" " '{print $2}'
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0