Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular Expression Search Pattern

Status
Not open for further replies.

helpeachother

Programmer
Joined
Jun 1, 2005
Messages
13
Location
CA
Hello, everyone:

I am a new member of this group and need your help with the following search pattern I wrote. I am tryinhg to get the numbers of the 4th column (Cell) and same them as "bts", but it does nt work. Will you please tell me what is wrong with my code? Thanks.

Here is the code:

pattern = "(?:(A-Z0-9-_)*)\s+(?:-|1)\s+(?:-|d+)\s+(?:-|Alpha|Beta|Gamma|Delta|Epsilon|Zeta|Eta|Theta|Iota|Kappa)\s+(?<bts>\d+)\s+"

Here is aprt of the file I use the pattern to get the cell number.

BSMCI > table msector



MSECTOR > view full
view full


MSECTOR > list all
list all
WARNING: This table has 1505 entries.
Listing them all may take some time.
CELLNAME NUM FREQ SECTOR CELL BAND PILOT MCTATH MCTAPR PILOTG SYNCG PAGEG HOBTH CBTH MPTTPR RFMNUM ALDUSERS RADIOCFG NUMPCH PAGEFREQ EXTFREQ CL ECLRQI ECLFREQ ECLRQCI SRL FEFSCAVGPOW FEFSCVARPOW VCFSCTOTPOW MAXFWDDRATE MAXREVDRATE RCDAVSELN RCDAVAADJ RCDADSELN RFCHGCAPTHR 3G2GTHRG SYNCCH TXPFDC PRAT SCHAPM ACHACQSW ACHDEMSW TCHAQSW TCHDEMSW NUMQPCH QPCHRATE QPCHPLP RLGAINTP MAXVOICE MAXDATA MAXDFCH MAXDSCH ENHSRSH ECELLRINGS PCOCE ACOCM
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================


-1900bandDefault- - - - - 1900 120 64 0 164 64 138 0 256000 -202 1 Nochecking Voice2G 1 0 0 () F () () () 20 20 20 SDRL16x SDRL16x rcda0 0 rcda0 0 60 T 6 Full 0 2400 500 500 500 0 4800 Same 0 100 0 50 100 F 0 F Off

-800bandDefault- - - - - 800 120 64 0 164 64 138 0 256000 -202 1 Nochecking Voice2G 1 0 0 () F () () () 20 20 20 SDRL16x SDRL16x rcda0 0 rcda0 0 60 T 6 Full 0 2400 500 500 500 0 4800 Same 0 100 0 50 100 F 0 F Off

MC1900BTS750_GROWTH 1 750 Alpha 750 1900 136 2 0 127 45 106 0 112800 -239 1 Nochecking Data3G1xEVDO 1 750 2047 (750) F (750) (F) () 20 20 20 SDRL16x SDRL16x rcda0 0 rcda0 0 60 T 9 Full 0 2400 2400 500 600 0 4800 Same 0 85 100 95 100 F 0 F Off

MC1900BTS750_GROWTH 1 750 Beta 750 1900 140 2 0 127 45 106 0 112800 -239 2 Nochecking Data3G1xEVDO 1 750 2047 (750) F (750) (F) () 20 20 20 SDRL16x SDRL16x rcda0 0 rcda0 0 60 T 9 Full 0 2400 2400 500 600 0 4800 Same 0 85 100 95 100 F 0 F Off

MC1900BTS750_GROWTH 1 750 Gamma 750 1900 144 2 0 127 45 106 0 112800 -239 3 Nochecking Data3G1xEVDO 1 750 2047 (750) F (750) (F) () 20 20 20 SDRL16x SDRL16x rcda0 0 rcda0 0 60 T 9 Full 0 2400 2400 500 600 0 4800 Same 0 85 100 95 100 F 0 F Off

MC1900BTS751 1 725 Alpha 751 1900 4 2 0 180 0 0 0 220000 -170 1 Nochecking Voice2G 1 725 725 (725) F () () () 20 20 20 SDRL16x SDRL16x rcda0 0 rcda0 0 60 T 9 Full 0 1000 512 512 512 0 4800 Same 0 100 0 50 100 F 0 F Off

MC1900BTS751 1 725 Beta 751 1900 8 64 0 180 0 0 0 220000 -170 2 Nochecking Voice2G 1 725 725 (725) F () () () 20 20 20 SDRL16x SDRL16x rcda0 0 rcda0 0 60 T 9 Full 0 1000 512 512 512 0 4800 Same 0 100 0 50 100 F 0 F Off

MC1900BTS751 1 725 Gamma 751 1900 12 64 0 180 0 0 0 220000 -170 3 Nochecking Voice2G 1 725 725 (725) F () () () 20 20 20 SDRL16x SDRL16x rcda0 0 rcda0 0 60 T 9 Full 0 1000 512 512 512 0 4800 Same 0 100 0 50 100 F 0 F Off


Thanks,

K. H. Wright
 
Just curious: this looks like it's neatly space delimited. If so, does

@stuff=split /\s+/;print "$stuff[4]\n"

help?

Tony Lawrence
Linux/Unix/Mac OS X Resources
 
or maybe just use an array slice:

Code:
while(<DATA>){
 my $cell_number = (split(/\s+/))[4];
 print "$cell_number\n";
}

I have no idea what this means:

and same them as "bts",

and this made no sense to me:

Here is aprt of the file I use the pattern to get the cell number.

BSMCI > table msector



MSECTOR > view full
view full


MSECTOR > list all
list all
WARNING: This table has 1505 entries.
Listing them all may take some time.

maybe soneone else knows what you mean by that.
 
Hi helpeachother

It seems to be cellular data.

Listen, It looks like space delimited text as pcunix mentioned.

BTW, Are you making a query on an specific telecomm equipment and you access it from a network management system? or is it a database?

if it is a telecomm equipmment, maybe you should be able to execute this command from your perl script and save the result in an array like:

@myoutput=`My command`;
the other thing, if it's a database, maybe you should be able to specify a delimitier different to blank space.
Sometimes if there is no value for a particular field, the split by space will provide a wrong value.

I am quite curios? What kind of Techology is it? Is it Nortel GSM?

Cheers!



dmazzini
GSM System and Telecomm Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top