Tags:
create new tag
view all tags

SID-00286: Get substr of a variable like $topic

Status: Answered 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

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title Get substr of a variable like $topic
SupportCategory CategorySearch
TWiki version 4.0.5
Server OS SunOs
Web server Apache
Perl version 5
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2009-06-02 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.