Hi Everyone , have a nice
i would need a little help on this
i have file which contains blocks such as given below
<hgsdp:msisdn=923228719047,loc;
HLR SUBSCRIBER DATA
SUBSCRIBER IDENTITY MSISDN IMSI STATE AUTHD 923228719047 410072110070614 CONNECTED AVAILABLE
NAM
1
LOCATION DATA
VLR ADDRESS MSRN MSC NUMBER LMSID
4-923210002011 923210002011
MS PURGED IN VLR
END
<hgsdp:msisdn=923228276174,loc;
HLR SUBSCRIBER DATA
SUBSCRIBER IDENTITY MSISDN IMSI STATE AUTHD 923228276174 410072520066962 CONNECTED AVAILABLE
NAM
1
LOCATION DATA
VLR ADDRESS MSRN MSC NUMBER LMSID
4-923210002002 923210002002
MS PURGED IN VLR
END
now i want to filter out MSISDN based on MSC NUMBER ( bold above )
like i only want those MSISDNs in my output file which has MSC NUMBER = 923210002022
but would just describe this code line by line , so that i don need to tele the whole output , whould just analyze code and this would be enuff to make sure that output is correct
Line 1) Through command line, pass to the awk script the value of the msc number to find. You can also define this variable in the body of the script if you want.
Lines 2-6) When you find a line beginning with "<", extract the msisdn number. The first split will generate the array "a", which contains two string elements: the first part is "<hgsdp:msisdn", the second part is "923228719047,loc;".
The second split takes in input the second element of the "a" array and creates a "b" array by dividing the string, using the "," delimiter. So, the first element of array "b" is the number we need.
Assuming the msisdn numbers are all 12 chars in length, we could have used a much more simpler function: substr($0, 15, 12).
Lines 7-9) When you find a line beginning with "VLR", jump to the next line. Here, in the 2nd field, we have the msc number referring to the msisdn found before.
Lines 10-12) If the msc found is equal to the msc we specified in the command line, print the msisdn number.
Line 13) The input file to feed the awk script
Well, now that I've re-read the script, it is possible to use the same logic of lines 7-9 to extract the msisdn:
As usual, there will be another bunch of methods to extract the same information, maybe in a better way... The important thing is getting the result
Gents,
I am stuck at end of my process.. I got the following file (input). And I want to filter it, checking from the column 2 to the end of the file.
The condition is if in any column from cl2 to the end exist value 3, not filter, but if there is not value 3, should print all the row(output... (6 Replies)
Not sure if this is the correct forum for this question. I have two files. file1.zip, file2
Input:
file1.zip
col1, col2 , col3
a , b , 0:0:0:0:0:c436:9346:d40b
x, y, 0:0:0:0:0:880:39f9:c9a7
m, n , 0:0:0:0:0:80c7:9161:fe00
file2.txt
col1
c4:36:93:46:d4:0b... (1 Reply)
Hi Folks,
I have a text file with lots of rows with duplicates in the first column, i want to filter out records based on filter columns in a different filter text file.
bash scripting is what i need.
Data.txt
Name OrderID Quantity
Sam 123 300
Jay 342 498
Kev 78 2500
Sam 420 50
Vic 10... (3 Replies)
I have a main file:
...
17,466971 0,095185 17,562156 id 676
17,466971 0,096694 17,563665 id 677
17,466971 0,09816 17,565131 id 678
17,466971 0,099625 17,566596 id 679
17,466971 0,101091 17,568062 id 680
17,466971 0,016175 17,483146 id... (4 Replies)
I have a .kml file. So I want filter the .kml to get only the tags that have this numeric codes that they are in a text file
11951
11952
74014
11964
11965
11969
11970
11971
11972
60149
74018
74023
86378
11976
11980
11983
11984
11987 (5 Replies)
Hi,
I have a file with hundreds of records.
There are four fields on each line, separated by semicolons.
Name
Height (meters)
Country
Continent (Africa,Asia,Europe,North America,Oceania,South
America,The Poles)
I need to Write the command to find display how many mountains appear... (1 Reply)
Hello
I have an input file which is tab delimited.In my unix script I have search for a particular pattern.If it is NOT present then I have to write in an output file.
Eg.Input file is :
123 hello 7779 hi hkjh88 hahah
678 hello 90845 ti hkjsdfh 9324
And the search string is "123... (2 Replies)
Reposting since I didnt not get any reply.
I have a problem while filtering records from a file. Can somebody help please?
For eg: Consider the below files
Record file:
0003@00000000000190@20100401@201004012010040120100401@003@... (1 Reply)
Hi all !
I have a file name file1 like this :
/A
/A/1
/A/2
/B
/B/3
/B/4
/tmp/C
/tmp/C/5
/tmp/C/6
I want to write a script to take content from file2 and print out to file2 only these lines :
/A
/B
/tmp/C (12 Replies)