Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I need to extract only particular values below the specific columns Mac Address and Ports from a text file. please help me to filter those values alone.

Please see the below example :

terminal length 0
COE_IPT_ACCESS_SWITCH#
COE_IPT_ACCESS_SWITCH#show mac-address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
 All    0100.0ccc.cccc    STATIC      CPU
 All    0100.0ccc.cccd    STATIC      CPU
 All    0180.c200.0000    STATIC      CPU
 All    0180.c200.0001    STATIC      CPU
 All    0180.c200.0002    STATIC      CPU
 All    0180.c200.0003    STATIC      CPU
 All    0180.c200.0004    STATIC      CPU
 All    0180.c200.0005    STATIC      CPU
 All    0180.c200.0006    STATIC      CPU
 All    0180.c200.0007    STATIC      CPU
 All    0180.c200.0008    STATIC      CPU
Total Mac Addresses for this criterion: 43
COE_IPT_ACCESS_SWITCH#
COE_IPT_ACCESS_SWITCH#
Posted
Updated 14-Oct-14 9:58am
v2
Comments
Kamal Kannan 14-Oct-14 8:24am    
Need output as below

Mac Address Ports
----------- -----
0100.0ccc.cccc CPU
0100.0ccc.cccd CPU
0180.c200.0000 CPU
0180.c200.0001 CPU
0180.c200.0002 CPU
0180.c200.0003 CPU
0180.c200.0004 CPU
[no name] 14-Oct-14 8:47am    
So read the string, split the string, extract the data you want.
Sinisa Hajnal 14-Oct-14 9:18am    
What have you tried? Where is your code? What is the problem?
[no name] 14-Oct-14 11:08am    
we are still not understand your problem

1 solution

Please, see my past answers[^]. I answered similar questions several times.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900