Hi List,<br><br>I am using python to run command line utilities on Linux machine.<br>I came across textfsm and feel that it fits my requirements.<br><br>Here is the structure of the output from the 2 utilities<br><br>Command 1:<br>
<br>Id Address Port Location State Tenant count Max tenants Description<br>-- ---------- ---- -------- ------ ------------ ----------- ------------<br>1 10.0.32.20 8443 - ACTIVE 7 12 -<br>2 10.0.32.21 8443 - ACTIVE 7 12 -<br>
3 10.0.32.22 8443 - ACTIVE 7 12 -<br><br>Command 2:<br><br>1 2012-04-04 19:54 00DD0000000q3di GOLD Company 1 CA360 ACTIVE Yes <a href="https://10.0.32.26:7000">https://10.0.32.26:7000</a> 8 50<br>
17 2012-04-09 23:01 00Dd0000000efRF SILVER Company 2 CA360 ACTIVE Yes <a href="https://10.0.32.20:7014">https://10.0.32.20:7014</a> 1 440<br>27 2012-04-10 03:42 00Dd0000000efdS TRIAL Company 3 CA360 ACTIVE Yes <a href="https://10.0.32.23:7021">https://10.0.32.23:7021</a> 4 10<br>
32 2012-04-11 11:24 00Dd0000000eiGb TRIAL Company 4 CA360 INACTIVE Yes <a href="https://10.0.32.21:7000">https://10.0.32.21:7000</a> 2 25<br><br>I found this link documenting how to parse tabular data: <a href="http://code.google.com/p/textfsm/wiki/TextFSMCodeLab#Parsing_tabular_data">http://code.google.com/p/textfsm/wiki/TextFSMCodeLab#Parsing_tabular_data</a><br>
My question is, what is the syntax of the pattern matching used. Is it the same as python regexp?<br>Any other documentation/examples available for this library?<br><br>I'm also open to suggestions of using other libraries.<br>
Basically, I would like this to be semantically as close as possible to working with data extracted from a database.<br><br>Thanks and regards,<br>Ferdi<br>