how to grep

Iranna Mathapati iranna.gani28 at gmail.com
Fri Aug 4 08:33:24 EDT 2017


Hi Team,

How to grep values from below out put string.

pattern should include  "Fabric Module".

grepping Fabric module values only

str = '''
22   0    Fabric Module                         J8N-C9508-FM          ok

24   0    Fabric Module                        J8N-C9508-FM          ok

26   0    Fabric Module                        J8N-C9508-FM          ok

22   0    16-slot Fabric Module                 J8N-C9516-FM-E        ok

24   0    16-slot Fabric Module                 J8N-C9516-FM-E        ok'''

output = [22,24,26,22,24]


Thanks
Iranna M



More information about the Python-list mailing list