parse data from text file

rharrington10

New Member
Joined
Feb 8, 2016
Messages
4
Need to parse parts of a raw text file and convert it to an Excel file. Seems simple, and have tried multiple approaches, but none have been successful. Any assistance would be greatly appreciated.

I would provide actual files, but do not have permissions to post attachments.

sample data:

!
--More-- voice-port 2/0/0
no snmp trap link-status
cptone AP
timeouts interdigit 4
description Analog phone
station-id name winter Analog
station-id number 58572000
caller-id enable
!
voice-port 2/0/1
no snmp trap link-status
cptone AP
timeouts interdigit 4
description Analog phone
station-id name winter Analog
station-id number 58572001
caller-id enable
!
voice-port 2/0/2
no snmp trap link-status
cptone AP
timeouts interdigit 4
description Analog phone
--More-- station-id name winter Analog
station-id number 58572002
caller-id enable
!
voice-port 2/0/3
no snmp trap link-status
cptone AP
timeouts interdigit 4
description Analog phone
station-id name winter Analog
station-id number 58572003
caller-id enable
!
voice-port 2/0/4
no snmp trap link-status
cptone AP
timeouts interdigit 4
description Analog phone
station-id name winter Analog
station-id number 58572004
caller-id enable
!
voice-port 2/0/5
--More-- no snmp trap link-status
cptone AP
timeouts interdigit 4
description Analog phone
station-id name winter Analog
station-id number 58572005
caller-id enable
!
dial-peer voice 9992000 pots
corlist incoming international
description Analog phone
translation-profile incoming tp_add_cor
--More-- huntstop
preference 4
destination-pattern 58572000
progress_ind alert strip
authentication username 58572000 password 7 58572000
port 2/0/0
!
dial-peer voice 9992001 pots
corlist incoming local
description Analog phone
translation-profile incoming tp_add_cor
huntstop
preference 4
destination-pattern 58572001
progress_ind alert strip
authentication username 58572001 password 7 58572001
port 2/0/1
!
dial-peer voice 9992002 pots
corlist incoming international
description Analog phone
translation-profile incoming tp_add_cor
huntstop
--More-- preference 4
destination-pattern 58572002
progress_ind alert strip
authentication username 58572002 password 7 58572002
port 2/0/2
!
dial-peer voice 9992003 pots
corlist incoming national
description Analog phone
translation-profile incoming tp_add_cor
huntstop
preference 4
destination-pattern 58572003
progress_ind alert strip
authentication username 58572003 password 7 58572003
port 2/0/3
!
dial-peer voice 9992004 pots
corlist incoming international
description Analog phone
translation-profile incoming tp_add_cor
huntstop
preference 4
--More-- destination-pattern 58572004
progress_ind alert strip
authentication username 58572004 password 7 58572004
port 2/0/4
!
dial-peer voice 9992005 pots
corlist incoming international
description Analog phone
translation-profile incoming tp_add_cor
huntstop
preference 4
destination-pattern 58572005
progress_ind alert strip
authentication username 58572005 password 7 58572005
port 2/0/5





desired results:

voice-portno snmp trapcptonetimeoutsdescriptionstation-id namestation-id numbercaller-idcorlist incoming
2/0/0link-statusAPinterdigit 4Analog phonewinter Analog58572000enableinternational
2/0/1link-statusAPinterdigit 4Analog phonewinter Analog58572001enablelocal
2/0/2link-statusAPinterdigit 4Analog phonewinter Analog58572002enableinternational
2/0/3link-statusAPinterdigit 4Analog phonewinter Analog58572003enablenational
2/0/4link-statusAPinterdigit 4Analog phonewinter Analog58572004enableinternational
2/0/5link-statusAPinterdigit 4Analog phonewinter Analog58572005enableinternational
2/0/6link-statusAPinterdigit 4Analog phonewinter Analog58572006enableinternational
2/0/7link-statusAPinterdigit 4Analog phonewinter Analog58572007enableinternational
2/0/8link-statusAPinterdigit 4Analog phonewinter Analog58572008enableinternational
2/0/9link-statusAPinterdigit 4Analog phonewinter Analog58572009enableinternational
2/0/10link-statusAPinterdigit 4Analog phonewinter Analog58572010enableinternational
2/0/11link-statusAPinterdigit 4Analog phonewinter Analog58572011enableinternational
2/0/12link-statusAPinterdigit 4Analog phonewinter Analog58572012enableinternational
2/0/13link-statusAPinterdigit 4Analog phonewinter Analog58572013enableinternational
2/0/14link-statusAPinterdigit 4Analog phonewinter Analog58572014enableinternational

<tbody>
</tbody>
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
11,703
Office Version
2007
Platform
Windows
Reviewing your examples, I see that the following data does not match your headlines, what is done in those cases?

dial-peer voice 9992005 pots
corlist incoming international
description Analog phone
translation-profile incoming tp_add_cor
huntstop
preference 4
destination-pattern 58572005
progress_ind alert strip
authentication username 58572005 password 7 58572005
port 2/0/5
desired results:
voice-portno snmp trapcptonetimeoutsdescriptionstation-id namestation-id numbercaller-idcorlist incoming

<tbody>
</tbody>
 

rharrington10

New Member
Joined
Feb 8, 2016
Messages
4
sorry, first post. should have put a separator in there to distinguish. there are two elements. the voice port and the dial-peer. you've posted the second portion of the data. the ports match. only trying to capture the corlist incoming portion of the second element.
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
11,703
Office Version
2007
Platform
Windows
You could upload a txt file and a file of how it should look in excel.

You could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 

Watch MrExcel Video

Forum statistics

Threads
1,099,006
Messages
5,465,968
Members
406,457
Latest member
Pinky Rose Jordan

This Week's Hot Topics

Top