The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Is there a awk solution for this?? timj123 Shell Programming and Scripting 7 03-14-2008 06:28 AM
need solution for scripting kkc Shell Programming and Scripting 14 01-31-2008 09:17 PM
Sun and backup solution Jshwon SUN Solaris 1 10-23-2007 12:54 PM
Grep solution Amruta Pitkar Shell Programming and Scripting 3 05-03-2007 02:57 AM
Linux as a NAS solution? kjbaumann Linux 1 08-30-2006 12:09 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-13-2008
racbern racbern is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 26
Is There a Sed Solution for This?

Hi All,

I'm trying to use sed to extract data within a String, but I'm having problems with sed command:

Text:
STATUS OSRC_R6_0_MENT_R1H_CU M_901662 R1H_LV1_20080313


Based from the Text above, I just need to extract this data
R6_0
R1H_CU
LV1


Is there a solution for this in sed?


Thanks a lot in advance.


Regards,
racbern
  #2 (permalink)  
Old 03-13-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Question Need to know more

For instance:
(a) looking for something beginning at position 13
(b) looking for something after "OSRC_"
(c) the next four characters - getting the "R6_0"
(d) next two parameters separated by delimiter "_"

Perhaps a longer sample input and desired outputs.
Sponsored Links
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 06:29 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
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