Tags:
create new tag
view all tags

Question

I need help with the Search Variable. I looked all over supportweb and found [HowToSearchInfoFromTable] which was close but it's still not working in my case. I'm using a horizontal Table. The thing is that the table is on TopicPage1 and I want the results to be on TopicPage2. I tried mimicking the formate you had:

%SEARCH{ "\| \*Who\* \|" topic="TopicPage1" regex="on" multiple="on" nonoise="on" format="$pattern(^\|[^\|]*(\|[^\|]*\|).*)" }%

Here is the type of table I'm using:

EDITTABLE EXAMPLE

Priority Item Description Due Date Who Status Comments
3 Testing Search Variable1 January 19th Mister Long In Development  
4 Testing Search Variable2 February 15th Mister Long In Development  
3 Testing Search Variable1 January 19th Mister Calderon In Development  
3 Testing Search Variable2 TBD Mister Calderon In Development  

Desired Results I'm looking to pull into TopicPage2 Just the names of those in the table above and the description. And as they update tables in TopicPage1 or move assignments around it just updates the project page2

Environment

TWiki version: unspecified
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- RobertLong - 13 Mar 2007

Answer

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.

I am not exactly sure about the result you want - but I guess you want, as a result of the search, a two-column table consisting of only the "Item Description" and "Who" columns.

TWiki can't do searches for a field name (which is, actually, just a table header). So what you need is just a search string which will match every single line of your table - and then use a tricky format string to extract the second and fourth column of these matches. Note that I've used two separate $pattern elements in the format string, which is required if you want to exclude the "Due Date" column.

My search string will match every table row with at least four colums, so that the "Environment" table in this topic will not be included in the results. As a minor tweak I pulled the vertical bars outside the pattern capture, so that it is easier to juggle the columns around.

%SEARCH{ "^\|[^\|]*\|[^\|]*\|[^\|]*\|[^\|]*\|" topic="HowToUseSearchVariable" regex="on" multiple="on" nonoise="on" format="| $pattern(^\|[^\|]*\|([^\|]*).*) | $pattern(^\|[^\|]*\|[^\|]*\|[^\|]*\|([^\|]*).*) |" }%

Item Description Who
Testing Search Variable1 Mister Long
Testing Search Variable2 Mister Long
Testing Search Variable1 Mister Calderon
Testing Search Variable2 Mister Calderon

-- HaraldJoerg - 14 Mar 2007

Nice one Harald. Closing this question...

-- PeterThoeny - 15 Mar 2007

NICE INDEED!! THANK YOU!

-- RobertLong - 15 Mar 2007

Change status to:
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-03-15 - RobertLong
 
  • 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.