Skip to content

Instantly share code, notes, and snippets.

@PuercoPop
Forked from anonymous/gist:7443619
Last active December 28, 2015 04:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PuercoPop/7444108 to your computer and use it in GitHub Desktop.
Save PuercoPop/7444108 to your computer and use it in GitHub Desktop.
# -*- coding: latin-1 -*-
import re
from os import join
myP = re.compile(r'^\s+(\d+)\s+([a-zA-Z0-9¨®_\-?]+)\s+(\w+)\s+([\w<>]+)\s+(\w+)\s+([\w<>\s{4}]+)\s+(.+[d|p])\s{4}+$')
base_dir = 'D:\Hector\\'
with open(join(base_dir ,"UCELL20130913.txt"), 'r') as input_file:
with open('dsp_ucell_processed.csv', 'w') as fh_output:
header = 'Cell_ID' + ',' + 'Cell_Name' + ',' + 'Operation_State' + ',' + 'Administrative_State' + ',' + 'DSS_State' + ',' + 'State_Explanation' + '\n'
fh_output.write(header)
for line in input_file:
myData = re.match(myP, line)
if myData:
line_to_write = mydata.group(1) + ',' + myData.group(2)+ ',' + myData.group(3)+ ',' + myData.group(4)+ ',' + myData.group(5) + ',' + myData.group(6) + '\n'
fh_output.write(line_to_write)
DSP UCELL:DSPT=BYCELL;
AQPPCSRNC1_RSO2
+++ RSO2RNC03 2013-09-13 17:16:44
O&M #2435423
%%/*7767336*/DSP UCELL:DSPT=BYCELL;%%
RETCODE = 0 Execution succeeded.
Cell state information
----------------------
Cell ID Cell name Operation state Administrative state DSS state State explanation
13061 CS_PCS_1306_Aguas_Calientes_1 Available Unblocked Unconfigured Cell is setup and enabled
13062 CS_PCS_1306_Aguas_Calientes_2 Available Unblocked Unconfigured Cell is setup and enabled
13063 CS_PCS_1306_Aguas_Calientes_3 Available Unblocked Unconfigured Cell is setup and enabled
13101 CS_PCS_1310_San_Blas_1 Available Unblocked Unconfigured Cell is setup and enabled
13102 CS_PCS_1310_San_Blas_2 Available Unblocked Unconfigured Cell is setup and enabled
13103 CS_PCS_1310_San_Blas_3 Available Unblocked Unconfigured Cell is setup and enabled
13111 CS_PCS_1311_Churcana_1 Available Unblocked Unconfigured Cell is setup and enabled
13112 CS_PCS_1311_Churcana_2 Available Unblocked Unconfigured Cell is setup and enabled
11041 MQ_PCS_1104_Cerro_El_Hueco_1 Available Unblocked Unconfigured Cell is setup and enabled
11042 MQ_PCS_1104_Cerro_El_Hueco_2 Available Unblocked Unconfigured Cell is setup and enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment