in reply to
Re: Can I match a range from an array?
in thread Can I match a range from an array?
Some telcom intelligence that might have a better grasp on what I'm trying to do.
OK what I need to do. Boss gave me a list of cell site locations. They're coded to the BASE10.
Now I also have a call record that contains the lines "Cell Site Blah Blah"
Now I have to limit the info returned when I do a search. I search first by record block, MSTerminating, MSORIGINATING, etc.. Then we narrow it down some more saying OK now only if we see the correct number in the appropriate record block. I don't specify a record block just the MSISDN because really in this entire script that is the anchor.
Everything else revolves around finding that. The script works. It prints out what lines I tell it under the right record heading for the number that I specify.
The problematic portion is what I have to do next.
OK as I said my bosses list that he gave me has these types of entries in it:
Now if I type "10011" into a BASE converter going from BASE 10 to BASE 16 the number that is popped out is "271B" which is also at the end of some of the "Cell site" lines in the call record file. With the numbers I know what cell site "271B" to call "GRN001A" because "10011" = "271B" which I will find in the call record on line5 for a "MSTerminating" record block see the "271B" or whole line and have it reprint out as -
Cell ID for First Cell: MCC: 310 MNC: 64 LAC: x'44D CI: x'GRN001A - This abbreviation helps us because now we know that the site is in Greenville prior with the 271B we didn't know where it was.
All this has been accomplished B4 except that I have 387 of these locations to give the script. It's easy to specify one "if you match it then print it"
Problem is "If you match any of these cell sites print the right one" That's my problem, I can't tell the script "If you find any of these" or "If you find it print out the correct one"
Now that I've described my process, you said you're using a call record also. Call Records are fairly standard I know your from a land base so yours are probably different but they are both call records so it should run along the same lines. So maybe that can help me. So post your code if you don't mind.
The snippet of code you posted is correct what it does is this:
Split @lines by new line (So it's reading in paragraphs)
Next line @lines == 1
Thats saying if it's true then $lastHeading = line0 or the first elmement of the array which are the record titles such as "MSTerminating, MSORIGINATING.
Then a next; to go on to the rest of the code. It works.
Oh I don't know if this would be of interest to you but I have a script that takes call records and can sort through them by date and time (file form is this) TTFILE03.3483010712234522 = .(4random numbers)(6digit date YYMMDD)(6digit time HHMMSS)
the script returns the matching call records then searches them for a phone number and spits out the lines I want. I have a built shell menu for it. It's the same thing I'm doing here (Well this is just part of it) I'm modifying the muscle portion of the script, the part that rips out all of the lines I want based off the phone number.
Modifying because the original is in AWK and I hate AWK and 2 because I have to do this cellsite translation garbage. It's a fun challenge but I need to grab a smoke. I hope I explained the code snippet good enough.
My deficit for writing nodes is my sparatic type of writing. That's what happens with 2 cappacuinos (ENGLISH TOFFEE!)