Author Posts

November 22, 2017 at 2:54 pm

Hi all,
it's my first post in this forum, but I have read more topic where I have found great indication and suggestion.

Now I have the first problem with powershell,
I have a startup (configuration file) of a router,
I would like to extract in a csv file information about the interfaces.

....
....
interface gpon-olt_1/3/4
  onu 1 type pippo pw 12345678
  onu 1 profile line 20M remote 110
  onu 2 type pippo pw 12345679
  onu 2 profile line 20M remote 110
  onu 3 type pippo pw 12345680
  onu 3 profile line 20M remote 110
  onu 4 type pippo pw 12345681
  onu 4 profile line 20M remote 110
!
interface gpon-olt_1/3/5
  onu 1 type pippo pw 12345682
  onu 1 profile line 20M remote 110
  onu 2 type pippo pw 12345683
  onu 2 profile line 20M remote 110
  onu 3 type pippo pw 12345684
  onu 3 profile line 20M remote 110
  onu 4 type pippo pw 12345685
  onu 4 profile line 20M remote 110
....
....
....

I would like to have this result:

interface	Onu	type	pw
gpon-olt_1/3/4	1	pippo	12345678
gpon-olt_1/3/4	2	pippo	12345679
gpon-olt_1/3/4	3	pippo	12345680
gpon-olt_1/3/4	4	pippo	12345681
gpon-olt_1/3/5	1	pippo	12345682
gpon-olt_1/3/5	2	pippo	12345683
gpon-olt_1/3/5	3	pippo	12345684
gpon-olt_1/3/5	4	pippo	12345685

thanks all

November 23, 2017 at 9:30 pm

What is your problem? What have you tried? What is not working?

November 23, 2017 at 11:17 pm

The following video might help you understand a little more:

Sophisitcated Techniques of Plain Text Parsing