-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help with TTP for fixed column table #15
Comments
This should do it for this particular piece of data
How it works - lots of regexes:
As you can see, this template, does not seems to be simple. Imagine how exciting it would be to troubleshoot any issues with it. For example, this slight variation will not be matched:
two spaces between 1000 and 1000BaseLX SFP While for humans it is easy to make sense out of tabular data, its not the easiest task to consume semi-tabulated data by program if its not regular, it would be better to use some other show commands output. For instance, this:
and this:
contains same information. However, it would be easier to extract data from latter sample because its more regular:
|
Added new match variable indicator
Key thing - checkout this test for complete example: ttp/test/pytest/test_headers_indicator.py Line 10 in 3363928
|
@dmulyalin - wow the headers addition is awesome! I am going to try this out today! Looking at the test code example, I am guessing that I can use the headers indicator for any fixed-width-single-line table output? Is that correct? If so, this new feature will be quite useful is so many use-cases!! |
I am curious how I would work with a text able that has a "multi-line" header like this:
|
Confirmed that the 😄 |
yes, that is correct - expect any fixed-width-single-line table to work fine. |
Need to clean up results to exclude unnecessary matches:
added this test as example: ttp/test/pytest/test_headers_indicator.py Line 194 in 4fbca6b
|
@dmulyalin - this is awesome, thank you. |
Yeah, have plans for new release, but need to update documentation and add more tests for new features. |
Hi @dmulyalin - I am having a very challenging time trying to create a TTP template to handle this tabular input. Would you have any suggestions? My two issues is (1) handling the case where the "Name" column is empty and is instead consuming the "Status" as "Name", and (2) Handling the case for Gi0/16 - I am using ORPHRASE but TTP is only consuming the first word and then making Status "te1/1/4".
I very much appreciate your help and guidance. Thank you!
The text was updated successfully, but these errors were encountered: