[Solved] How to use delimiter


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting [Solved] How to use delimiter
# 8  
Old 03-14-2012
can you post the output of

Code:
 
echo "dis ql(*) cluster(CT.CL.RIBRSBT3)"| runmqsc CT.QM.701t8

And the expected output format
# 9  
Old 03-14-2012
Instead of CT.CL.RIBRSBT3 i am using *, so it will check for all the clusters

for few queues out put is coming like this "
Code:
   BT.CL.AXMOFST1.EMB.AXM_TO_OFS_BO_CIT_RES.01 
   BT.CL.B2BOFST4.EMB.B2B_TO_OFS_FVA_VOL_RES.01"

few queues i am getting properly
Code:
"BT.CL.AIBTHT2.EMB.MWI_AIB_TO_TH_T2_REQ.01 , AIB, TH"

this format i am expecting for all the queues.

First condition is when there is TO word then it should pring before _TO and after TO_

Second condition is if there is no TO word in that it shold print last 4th and 3rd word. PFB expected output in this condition
Code:
"   CT.CL.BLAOFST1.EMB.CARDSTMNT_CIT_RES.01 , CARDSTMST  ,  CIT
    CT.CL.BLAOFST2.EMB.BILLING_VOL_RES.01 ,  BILLING  , VOL "


Last edited by Franklin52; 03-14-2012 at 07:14 AM.. Reason: Please use code tags for code and data samples, thank you
# 10  
Old 03-14-2012
Quote:
Originally Posted by darling
It is working for only few. PFB
Code:
    CT.CL.ESBTCPTD.TCP.TCP_TO_ESB_OCD_REQ_VUL.01
    CT.CL.EXPTHT1.EMB.MOP_EXP_TO_TH_T2_REQ.01 , EXP, TH

I want the words of before _TO and after TO_
Ok try with the below
Code:
s/.*[._]\([^_]*\)_TO_\([^_]*\)_.*/&, \1, \2/'

# Matches strings with and without TO
Code:
sed -e 's/.*[._]\([^_]*\)_TO_\([^_]*\)_.*/&, \1, \2/' -e '/TO/!s/.*[.]\([^_]*\)_\([^_]*\)_[^_]*$/&, \1, \2/'


Last edited by michaelrozar17; 03-14-2012 at 08:04 AM..
# 11  
Old 03-14-2012
First condition is working fine. i am trying to implement second condition. If i face any issues i will check with you. Thanks In Advance
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Insert tabs as delimiter

Hello all, I have an unstructured file with space as delimiter , which I want to structure. The output file should actually have only 5 columns with tab as delimiter. The 4th column can have only 3 values ( biological_process , cellular_component , molecular_function ) Here is how the... (12 Replies)
Discussion started by: ritakadm
12 Replies

2. Shell Programming and Scripting

Perl Code to change file delimiter (passed as argument) to bar delimiter

Hi, Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters. Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies

3. UNIX for Dummies Questions & Answers

[Solved] How to swap PIPE seperator delimiter?

I have file like below 1|4|OR|OLAP|INT|INT||CONSTANT|2012/08/07|9999/12/31|0|0|0|0|PRL|-358.1684563||||||||||36522|55791|LNR| 2|4|OR|OLAP|CLR|CLR||CONSTANT|2012/09/07|9999/12/31|0|0|0|0|PRL|-358.1684563||||||||||36522|57891|REGS|... (2 Replies)
Discussion started by: gkskumar
2 Replies

4. Shell Programming and Scripting

Shell script to put delimiter for a no delimiter variable length text file

Hi, I have a No Delimiter variable length text file with following schema - Column Name Data length Firstname 5 Lastname 5 age 3 phoneno1 10 phoneno2 10 phoneno3 10 sample data - ... (16 Replies)
Discussion started by: Gaurav Martha
16 Replies

5. Shell Programming and Scripting

how to get everything before the last delimiter?

hi all, i have a string with a number of "/"s as delimiter. and i want everything BEFORE the last delimiter i know to use basename to get everything after the last delimiter. thx a lot! (2 Replies)
Discussion started by: sunnydanniel
2 Replies

6. Shell Programming and Scripting

How to cut by delimiter, and delimiter can be anything except numbers?

Hi all, I have a number of strings like below: //mnt/autocor/43°13'(33")W/ and i'm trying to get the numbers in this string, for example 431333 please help thanks ahead (14 Replies)
Discussion started by: sunnydanniel
14 Replies

7. Shell Programming and Scripting

Help regarding the delimiter

Hi, I am trying to load data from a file to oracle DB. The file am using has a ";" as a delimiter. While I load the file, I want to check whether the file is having the correct delimiter or not. if not, the file should not be processed. Is there any way that i could handle this scenario using... (3 Replies)
Discussion started by: smileyreddy
3 Replies

8. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

9. Shell Programming and Scripting

Substring based on delimiter, finding last delimiter

Hi, I have a string like ABC.123.XYZ-A1-B2-P1-C4. I want to delimit the string based on "-" and then get result as only two strings. One with string till last hyphen and other with value after last hyphen... For this case, it would be something like first string as "ABC.123.XYZ-A1-B2-P1" and... (6 Replies)
Discussion started by: gupt_ash
6 Replies

10. UNIX for Dummies Questions & Answers

Delimiter

I am having the following file. I need to insert a delimiter in this file. I used sed but its not working. AAABBB 9 JJJ AAABBC 9 TTTTT AAABBA 8 JJJ AAABBC 7 TTTTT AAABBC 6 TTTTT Now i want the output file as: AAA|BBB| |9| |JJJ| AAA|BBC| |9| | |TTTTT| (3 Replies)
Discussion started by: sivakumar.rj
3 Replies
Login or Register to Ask a Question