Is There a Sed Solution for This?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Is There a Sed Solution for This?
# 1  
Old 03-13-2008
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  
Old 03-13-2008
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed or awk Solution

Hi I am having a csv file like this ahsh,90.82,add,32424,ahha hhdh,98.89,hdhdh,92728,neha hshs,you,97.7,hdhdhd,are,a jsjsj,wonderful,9788,79.9,aheh ahdh,95.5,girl, 2737,jolllI need to add width="100" to the value which is greater than 90 like decimal points but less than 100 Output... (5 Replies)
Discussion started by: kshitij
5 Replies

2. Shell Programming and Scripting

sed to check two condition need solution

Hi, I am having a file in below format server-1 Win2008:server-1-1700,1774,290104720,290104987:server-1 server-2 AIX:server-2-:server-2 server-2 I want the output like this Win2008:server-1-1700,1774,290104720,290104987:standalon-server AIX:server-2-:VIO-Sever I used the... (7 Replies)
Discussion started by: ranjancom2000
7 Replies

3. Shell Programming and Scripting

AWK or SED solution

Hello. I have big file data like this(part of file): .... 18210102021010000110 47401000000 021001 5166891.16 021011 5166891.16 18210602010020000110 47401000000 020701 8995421.00 021001 8995421.00 021011 8995421.00 030801 .08 18210604011020000110 47401000000 020701 9048.00 021001... (3 Replies)
Discussion started by: maxoff
3 Replies

4. Shell Programming and Scripting

Urgent solution for simple sed

Hi Im running this command on AIX in ksh. My input file samp1 contains 1 2 123 12345 When I execute the following sed i dont get a matching pattern sed -n '/{1}/p' samp1 Can anyone help me with this simple thing (3 Replies)
Discussion started by: raghav288
3 Replies

5. Shell Programming and Scripting

sed solution for condition checking

Hi all , Recently i came across this in FAQ's. I have a file cat rem.txt sreedhar 20 sreedhar 10 sreedhar 15 sreedhar 18 sreedhar 16 sreedhar 30 I have to replace sreedhar with "Sridhar" if the second parameter is > 18. I need to do it in "sed" only. I am wondering how this... (4 Replies)
Discussion started by: panyam
4 Replies

6. UNIX for Dummies Questions & Answers

Awk/sed solution for grep,cut

Hi, From the file "example" with lines like below, I need the int value associated with ENG , i.e, 123 SUB: ENG123, GROUP 1 SUB: HIS124, GROUP 1 .. .. Normally , i do grep ENG example | cut -d ' ' -f 2 | cut -c 4-6 Is it possible to do it in simpler way using awk/sed ? ... (5 Replies)
Discussion started by: priyam
5 Replies
Login or Register to Ask a Question