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
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
--
RobertLong - 13 Mar 2007
Answer
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