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 and shell scripting languages 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 11:38 PM
Extract Pattern Sequence jaganadh Shell Programming and Scripting 5 12-10-2007 11:06 AM
Extract if pattern matches Raynon Shell Programming and Scripting 20 10-29-2007 04:44 AM
Extract the Pattern aajan UNIX for Dummies Questions & Answers 6 08-08-2007 05:47 AM
Please help! Sed extract a pattern zhen Shell Programming and Scripting 11 09-18-2006 01:36 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-06-2008
manish205 manish205 is offline
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
  #2 (permalink)  
Old 02-06-2008
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,345

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
  #3 (permalink)  
Old 02-06-2008
manish205 manish205 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 5
Unhappy

it is showing only IPTel\platform
  #4 (permalink)  
Old 02-06-2008
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

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

Regards
  #5 (permalink)  
Old 02-07-2008
manish205 manish205 is offline
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
  #6 (permalink)  
Old 02-07-2008
pt14 pt14 is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 28
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}'
  #7 (permalink)  
Old 02-07-2008
manish205 manish205 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 5
Thumbs up

thanks this is working....
can u explain me the cmd.....
is there another way to do it...may be thru sed

Thanks
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0