Sponsored Content
Top Forums Shell Programming and Scripting Extract values only for certain tags Post 302928210 by fretagi on Wednesday 10th of December 2014 02:47:17 AM
Old 12-10-2014
Extract values only for certain tags

Hi

Please I need help on extracting values, of certain tags
Code:
MSISDN:

, and
Code:
IMSI:

in the following text file
Code:
entryDS: 1
nodeId: 11
MSISDN: 258827475309
IMSI: 643012111658984
NAM: 0                                                                
CDC: 41
IMEISV:: U3URIGF2hoc=
AUTHINFO: 0
TSMO: 0
CSP: 27
SUBSCSPVERS: 7
PDPCP: 11
SUBSPDPCPVERS: 5
RSA: 1
SUBSRSAVERS: 4
dn: IMSI=643012112814555,dc=imsi,ou=identities,dc=mcel
objectClass: alias
objectClass: IMSI
structuralObjectClass: alias
entryDS: 0
IMSI: 643012112814555
aliasedObjectName: mscId=bbbbbbbbbbbbbbbbb643012112814555,ou=multiSCs,dc=mcel
CAMP: 0
serv: CSPS
CSLOC: 5
VLRADD: 1925882200060
PSLOC: 0
SGSNNUM: 1925882200054
GSMMSRNMSCN:: AJFSiCIAYPA=
SCLOCSTATE: 6
SZONELOCSTATE: 6
PURGEDATECS:: DgsT
RVLRI: 0
RSGSNI: 0
GMSCADDRESS:: kVKIIgCQ9Q==
CSIVLRSUPP: 1
GSMMAPVERS: 3
GSMUEFEAT: 0
GSMDUALNUMSUP: 1
GPRSRELSUPP: 1
OBOPRI: 1
OBOPRE: 1
SCHAR:: BAA=
CAT: 10
DBSG: 1
OFA: 0
SOCB: 0
PWD: 0000
PWDC: 0
SOCFB: 0
SOCFNRC: 0
SOCFNRY: 0
SOCFU: 0
SODCF: 0
SOSDCF: 7
SOCLIP: 0
SOCLIR: 2
SOCOLP: 0
BS3G: 1
TS11: 1
TS21: 1
TS22: 1
CAW: 1
HOLD: 1
BAIC: 1
BAOC: 1
BICRO: 1
BOIC: 1
BOIEXH: 1
CFB: 1
CFNRC: 1
CFNRY: 1
CFU: 1
CLIP: 1
CLIR: 1
CAWTS10ST: 8
CFBTS10ST: 8
CFUTS10ST: 8
CFNRCTS10ST: 8
CFNRYTS10ST: 8
BAICTS10ST: 8
BAOCTS10ST: 8
BICROTS10ST: 8
BOICTS10ST: 8
BOIEXHTS10ST: 8
BAICTS20ST: 8
BAOCTS20ST: 8
BICROTS20ST: 8
BOICTS20ST: 8
BOIEXHTS20ST: 8
CAWBS30ST: 8
CFBBS30ST: 8
CFUBS30ST: 8
CFNRCBS30ST: 8
CFNRYBS30ST: 8
BAICBS30ST: 8
BAOCBS30ST: 8
BICROBS30ST: 8
BOICBS30ST: 8
BOIEXHBS30ST: 8
SMSCADD32:: kVKIIgAw8A==
SMSCEXPDATE32:: DgwF
MNRF: 1


dn: serv=Identities,mscId=bbbbbbbbbbbbbbbbb643012111658984,ou=multiSCs,dc=mcel
structuralObjectClass: CUDBService
objectClass: CUDBService
objectClass: mscIdentities
entryDS: 1
nodeId: 11
serv: Identities
CDC: 0
IMSI: 643012111658984
imsiMask: '0000000000010001'B
MSISDN: 258827475309
msisdnMask: '0000000000000001'B

I am trying to use either
Code:
sed

or
Code:
awk

, but with no success
This User Gave Thanks to fretagi For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract values from log file

I would like to write a shell script that will parse through a file similar to the sample below. The data in the file is redirected from rsync into a log file. I would like to call a shell script to parse through and pick out the number beside the percent sign inside the parentheses in the last... (5 Replies)
Discussion started by: wdympcf
5 Replies

2. Shell Programming and Scripting

how to extract values b/w two delimiters

Hi, Please help me to extrat values b/w two delimiters. $ echo $abc i want to extract the value 12345 b/w %. (5 Replies)
Discussion started by: tsaravanan
5 Replies

3. Shell Programming and Scripting

Extract XML Element Values

I have a rather large file with XML-style content. Each line contains one full XML entry. For example: 1:<Message><DNIS>1234</DNIS><UCID>3456</UCID><TransferGroup>XYZXYZ</TransferGroup></Message> 2:<Message><DNIS>9999</DNIS><UCID>2584</UCID><TransferGroup>ABCABC</TransferGroup></Message>... (1 Reply)
Discussion started by: sharpi03
1 Replies

4. Shell Programming and Scripting

Extract Values from CSV

Hi, I need to extract values from a CSV file based on some conditions as explained below: File format details: 1. each set starts with AAA only 2. number of columns is fixed 3. number of rows per set may vary (as they are having different CCC rows) Now, i need to extract 3rd column of... (3 Replies)
Discussion started by: prvnrk
3 Replies

5. Shell Programming and Scripting

to extract specific values twice in a file

Hi Friends, I have a file with the following values.. xyz.txt,12345.xml abc.txt,04567.xml cde.txt,12134.xml I would like to extract all the 2nd column values twice as shown in the example like 12345,12345.xml 04567,04567.xml 12134,12134.xml Please advice!! In the formus one of... (7 Replies)
Discussion started by: techmoris
7 Replies

6. Shell Programming and Scripting

extract key values

I am parsing a log with key values spread all over in the following fashion: TEST 1 SCHEME 12 SET EMPTY VARLEN SET TEST 1201 PARAM1 EMTY PARAM2 SET SCHEME 12 REFRESH TEST 8 I need to extract test number, my result should be 1 1201 8 I use awk for processing this log and use... (4 Replies)
Discussion started by: migurus
4 Replies

7. Shell Programming and Scripting

Is it possible to extract these values from the output

Hi, I would like to search based of "java" and "-Dplatform.home=" and store these two values in bash variables. ps -xef | grep <pid> wlsuser 15160 15144 0 Feb 20 ? 17:27 /app1/jdk150_07/bin/IA64N/java -server -Xms1536m -Dplatform.home=/app1/bea/weblogic92... (13 Replies)
Discussion started by: mohtashims
13 Replies

8. Shell Programming and Scripting

Extract values

hi I have a line as given below. I need to match "COLUMN_NAME" and get the every third value ie words in between quotes completely (' ') Sample Input - COLUMN_NAME Like '%value%' Or COLUMN_NAME Like '%value%' Or COLUMN_NAME Like '%value value%' Or COLUMN_NAME Like '%value%' OR... (5 Replies)
Discussion started by: Prashanth B
5 Replies

9. Shell Programming and Scripting

Extract values in a line using awk

hello all, I need your help in extracting values of some parameter within a line using awk. for example: i have the below line available in a file and i want to extract the values of only CustomerId, s_PackageId and s_HZINumbers in order the result to be as ... (13 Replies)
Discussion started by: nael_najib
13 Replies

10. Shell Programming and Scripting

Extract multiple values into corresponding variables

Here is my input # MANIFEST.MF Manifest-Version: 1.0 Build-Jdk: 1.6.0 Built-By: CM_TEAM Build_SvnRev: 662789 Build_Number: 13.0.0.0-JDK8 Build_Date: Wed 04/05/2017-20:48:19.17 Archiver-Version: Plexus Archiver Created-By: Apache Maven 3.1.0 Here is the expected output:... (4 Replies)
Discussion started by: kchinnam
4 Replies
All times are GMT -4. The time now is 07:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy