Question
I want to use
%SEARCH{...}% variable to extract contents from all the topics with the same formatted table, how can i do this? Thanks!
e.g. Table format of topics is like this:
- I want to extract
Project Name info from all the topics with the same formatted table.
- I want to get the result like this:
Environment
--
ShashaLuan - 05 Jun 2006
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.
Do a
FormattedSearch with a regular expression. Here is an example that pulls the project names from the tables in this topic.
Look at the raw text to see how it works. For your own use remove
topic="%TOPIC%".
--
PeterThoeny - 06 Jun 2006
Consider also using
TWikiForms based applications. Data entry and reporting is much easier.
--
PeterThoeny - 06 Jun 2006
This is great. What would the regex for this example look like?
| Veranstaltung |
Beginn |
Ende |
Beschreibung |
| abc |
12:00 |
18:00 |
lorem dolor ipsum |
| def |
17:00 |
19:00 |
lorem dolor ipsum |
| ghi |
12:00 |
18:00 |
lorem dolor ipsum |
| jkl |
09:00 |
18:00 |
lorem dolor ipsum |
| mno |
22:00 |
23:30 |
lorem dolor ipsum |
| pqr |
12:00 |
18:00 |
lorem dolor ipsum |
| stu |
14:00 |
18:00 |
lorem dolor ipsum |
| vwx |
18:00 |
21:00 |
lorem dolor ipsum |
I would like to display the lets say last 5 entries from the table above. I couldn't manage to include the table as it is part of
CommentPlugin user template so I am looking for some regex...
--
CarloSchulz - 10 Jun 2008
Tree possibilities (as far as I remember). Have a look at
-
$pattern() from standard %SEARCH{...}%
-
%EXTACT{...}% from FilterPlugin
-
%TABLEDATA{...}% from RenderTableDataPlugin
(1)+(2) need an appropriate regular expression to match the table row you want (something like
\|\s*(.*?)\s*\|\s*(.*?)\s*\|....)
(3) is more comfortable, see its docu.
--
MichaelDaum - 11 Jun 2008
Carlo, actually, to get the last 5 table rows you can simply do a pattern SEARCH that captures the 5 lines above a marker. I added
<!--EOT--> at the end of your example table. Here is the extraction:
| jkl |
09:00 |
18:00 |
lorem dolor ipsum |
| mno |
22:00 |
23:30 |
lorem dolor ipsum |
| pqr |
12:00 |
18:00 |
lorem dolor ipsum |
| stu |
14:00 |
18:00 |
lorem dolor ipsum |
| vwx |
18:00 |
21:00 |
lorem dolor ipsum |
--
PeterThoeny - 12 Jun 2008
Awesome, thank you guys
--
CarloSchulz - 15 Jun 2008
--
PrathibaRao - 02 Jul 2008
I seem to be having problem in writing a search function for getting result similar to question asked here. I write Search:
[P]rojectName scope="text
This search gives me the entire table i.e all columns and not the particular column and its values aseven though i have mentioned only
ProjectName
Please help
--
PrathibaRao - 02 Jul 2008
I seem to be having problem in writing a search function for getting result similar to question asked here. I write Search:
[P]rojectName scope="text
This search gives me the entire table i.e all columns and not the particular column and its values aseven though i have mentioned only
ProjectName
Please help
--
PrathibaRao - 02 Jul 2008