Skip to content

Instantly share code, notes, and snippets.

Created November 13, 2013 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/7443619 to your computer and use it in GitHub Desktop.
Save anonymous/7443619 to your computer and use it in GitHub Desktop.
# -*- coding: latin-1 -*-
import re
import os
source_dir = 'D:\Hector\\'
os.chdir(source_dir)
fh = open("UCELL20130913.txt")
array_lines = fh.readlines()
fh.close()
fh_output = open('dsp_ucell_processed.csv', 'w')
line_to_write = 'Cell_ID' + ',' + 'Cell_Name' + ',' + 'Operation_State' + ',' + 'Administrative_State' + ',' + 'DSS_State' + ',' + 'State_Explanation' + '\n'
fh_output.write(line_to_write)
# 7696 LIU07696c1_Los_Quechuas Available Unblocked Unconfigured Cell is setup and enabled
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}+$') # re.compile(r'^\s+(\d+)\s+([a-zA-Z0-9¨®_\-?]+)\s+(\w+)\s+([\w<>]+)\s+([\w\s]+)\s+$')
for line in array_lines:
myData = re.match(myP, line)
if myData:
#print(myData.group(2))
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)
# else:
# print(line)
fh_output.close()
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