Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Re: Can I match a range from an array?

by brassmon_k (Sexton)
on Aug 03, 2001 at 23:13 UTC ( #102103=note: print w/replies, xml ) Need Help??

in reply to Re: Can I match a range from an array?
in thread Can I match a range from an array?

Finally, 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:

GRN001A 310-640-1101-10011
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!)

The Brassmon_k
  • Comment on Re: Re: Can I match a range from an array?

Replies are listed 'Best First'.
Re: Re: Re: Can I match a range from an array?
by snafu (Chaplain) on Aug 04, 2001 at 00:07 UTC
    hahahaha...ok. Well, I don't do coffee so maybe my calmness and your coffeeness will bring us up to speed =P. First, yup, you're right. I come from the landline side. Actually, our cdr's are really different from what you've shown me. But that is neither here or there. Lets see if I am grasping your needs.

    You have 3 lists then (files). 1 is a list of cell sites in english. Another is a list of cell sites in base10. And finally you have the CDR.

    The file your boss gave you comes with the "cryptic" information that looks like a location id (GRN001A) with the NPA-NXX and suffix (310-640-1101) and then the base10 of identifier of the cell site (10011). The hex conversion of 10011 is 271B which will now match up with the call record (where MSTerminating shows the record block). Now, you want to convert the instance of

    Cell ID for First Cell: MCC: 310 MNC: 64 LAC: x'44D CI: x'271B
    Cell ID for First Cell: MCC: 310 MNC: 64 LAC: x'44D CI: x'GRN001A

    And you want to be able to do this in a massive conversion...
    Do I have the idea? :) As for my code, it wasn't going in the right direction. I will still post it if ya want...its nothing big. I would like to check out the script you are talking about that does the sorting on cdr's. That might help me in something I might undertake soon. Let me munch on this one you have brought up....permitted I understand now what you need and time permitting. I am at work right now which of course takes precedence.

    - Jim

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://102103]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2018-02-25 10:10 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (312 votes). Check out past polls.