parse data from text file

Status
Not open for further replies.

rharrington10

New Member
Joined
Feb 8, 2016
Messages
4
Trying to extract data from the following repeating prompts based on voice-port

voice-port
no snmp trap
cptone
timeouts
description
station-id name
station-id number
caller-id
corlist incoming

<colgroup><col></colgroup><tbody>
</tbody>

Have tried multiple approaches and all have failed. Any assistance would be greatly appreciated.


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 result:

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

<colgroup><col span="9"></colgroup><tbody>
</tbody>
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Duplicate https://www.mrexcel.com/forum/excel-questions/1091796-parse-data-text-file.html#post5247576

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread.
Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it.
Please be patient and do not attempt to post the question again.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top