The following is the file i want to work on
slot
slot : acu:1/1 planned-type : ngfc-f actual-type : ngfc-f oper-status : enabled
error-status : no-error availability : available
alarm-profile : none capab-profile : not_applicable
manufacturer : ALCL
mnemonic : NGFC-F
pba-code :
fpba-code : 3FE64993AABA
fpba-ics : 01
clei-code : VAUCAJ66AA
serial-no : 1743A13DC
failed-test : 00:00:00:00
lt-restart-time : 1970-01-01:05:45:00 lt-restart-cause : timezone_modified lt-restart-num : 0 restart-cnt-per-lt : 0
mgnt-entity-oamipaddr : 0.0.0.0 mgnt-entity-pairnum : 0 dual-host-ip : 0.0.0.0 dual-host-loc : none
slot
slot : acu:1/1 planned-type : ngfc-f actual-type : ngfc-f oper-status : enabled
error-status : no-error availability : available
alarm-profile : none capab-profile : not_applicable
manufacturer : ALCL
mnemonic : NGFC-F
pba-code :
fpba-code : 3FE64993AABA
fpba-ics : 01
clei-code : VAUCAJ66AA
serial-no : 1743A13DC
failed-test : 00:00:00:00
lt-restart-time : 1970-01-01:05:45:00 lt-restart-cause : timezone_modified lt-restart-num : 0 restart-cnt-per-lt : 0
mgnt-entity-oamipaddr : 0.0.0.0 mgnt-entity-pairnum : 0 dual-host-ip : 0.0.0.0 dual-host-loc : none
I want to iterate through the text file and need an output as below in CSV
Slot error-status alarm-profile manufacturer mnemonic
acu:1/1 no-error none ALCL NGFC-F
fopen=open("gthamelslot.txt")
for lines in fopen:
a = lines.strip()
b=a.split()
print(b[0][0])
I am stuck on this. Please help me with a logic with what can be done