SID-00286: Get substr of a variable like $topic
| Status: |
Answered |
TWiki version: |
4.0.5 |
Perl version: |
5 |
| Category: |
CategorySearch |
Server OS: |
SunOs |
Last update: |
16 years ago |
Hello,
In our documentation, we use topics that share a common abbreviation at the beginning of the topic name:
e.g.
MyServiceMain,
MyServiceOrganization,
MyServiceTroubleshooting, ...
In a %SEARCH operation, I can use the variable $topic, or extract a regular expression from its text, but I cannot extract a part of the $topic (in this case
MyService).
The goal is to build for our services, a table having as column, name, organisation, troubleshooting, ... and as line, the services. The cells are links to the specialized topics.
Thanks.
JM
--
TWikiGuest - 2009-04-28
Discussion and Answer
You can use some
SpreadSheetPlugin formulae to extract part of $topic. To give an idea, use
format="$percntCALC{$SET(base, $SUBSTITUTE(..., $topic))}$percnt", and then use
$GET(base) to get the base name.
Consider sharing with the TWiki community your SEARCH with CALC if you find it.
--
PeterThoeny - 2009-04-28
Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the
TWiki consultants if you need timely help. We invite you to
get involved with the community, it is more likely you get community support if you support the open source project!
--
PeterThoeny - 2009-06-02
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.