automation1Add my vote for this tag create new tag
, view all tags


Extract key/value pairs from topics to create a table dynamically


There are times when many simple tables need to be displayed as a single table with specific columns. This plugin simply parses the given topic, extracts the given key/value pairs, and creates a new table dynamically.

The first argument is the source topic. The next argument is the primary key. The dynamic table is sorted on this primary key. The remaining arguments are parsed and displayed in the dynamic table in the order they are listed in the command.

Syntax Rules



Given tables like the following in topic Systems.HardwareDetails:

| hostname | mailhost |
| location | work room |
| user | admin |
| use | sends mail |
| port | 99Z |
| production | yes |

| hostname | loghost |
| location | closet |
| user | admin |
| use | manages server logs |
| port | 99Z |
| production | yes |

Write this:

%PARSETOPICTABLES{Systems.HardwareDetails, hostname, location, port, production, use}%

The output is:

| *hostname* | *location* | *port* | *production* | *use* |
| mailhost | workroom | 99Z | yes | sends mail |
| loghost | closet | 99Z | yes | manages server logs |

ParseTopicTablesPlugin Settings

Plugin settings are stored as preferences variables. The following variables are used for this plugin.

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Extract key/value pairs from topics to create a table dynamically

  • Debug plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

  • Download the ZIP file from the plugin web (see below)
  • Unzip ParseTopicTablesPlugin.zip in your TWiki installation directory. Content:
    File: Description:
    data/TWiki/ParseTopicTablesPlugin.txt Plugin topic
    lib/TWiki/Plugins/ParseTopicTablesPlugin.pm Plugin Perl module
  • Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.
  • Test if the installation was successful:

%PARSETOPICTABLES{Plugins.ParseTopicTablesPlugin, hostname, location, port, production, use}%

Plugin Info

Plugin Author: TWiki:Main.MikeEggleston
Copyright: © 2007, MikeEggleston
© 2007-2010 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2010-11-10
Change History:  
2010-11-10: TWikibug:Item6530: Doc improvements
2007-01-12: Initial Version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.0
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ParseTopicTablesPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ParseTopicTablesPluginDev

Related Topics: TWikiPreferences, Main.TWikiPreferences, TWikiPlugins

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 ParseTopicTablesPlugin.md5 r1 manage 0.2 K 2010-11-11 - 08:05 PeterThoeny  
Compressed Zip archivetgz ParseTopicTablesPlugin.tgz r1 manage 5.0 K 2010-11-11 - 08:05 PeterThoeny  
Compressed Zip archivezip ParseTopicTablesPlugin.zip r2 r1 manage 6.6 K 2010-11-11 - 08:05 PeterThoeny  
Unknown file formatEXT ParseTopicTablesPlugin_installer r1 manage 3.4 K 2010-11-11 - 08:05 PeterThoeny  
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2013-10-16 - 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-2015 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.