Topic-per-row import of a CSV file into Foswiki

Ingredients

Recipe

  1. Run the script
  2. Return to this page, you should see a search search result below:
    Searched: form.name='Main.DataImportingToWiki.CSVDemoForm'
Number of topics: 0

%STARTSECTION{"prettyprint"}%%SEARCH{
     "%query%"
     type="query"
     web="%inweb%"
     header="%SEARCH{
         "%query%"
         type="query"
         web="%inweb%"
         nonoise="on"
         limit="1"
         format="   | *Topic* | $percentINCLUDE{\"%TOPIC%\" section=\"header\" webtopic=\"$web.$topic\"}$percent |"
     }%"
     format="   | [[$web.$topic][$topic]] | $percentINCLUDE{\"%TOPIC%\" section=\"row\" webtopic=\"$web.$topic\"}$percent |"
}%%ENDSECTION{"prettyprint"}%%STARTSECTION{"row"}%%FORMAT{
    "%QUERY{"'%webtopic%'/fields[NOT lc(attr)=~'h'].name"}%"
    type="string"
    format="$percentQUERY{\"'%webtopic%'/$item\"}$percent"
    separator=" | "
}%%ENDSECTION{"row"}%%STARTSECTION{"header"}%%FORMAT{
    "%QUERY{"'%webtopic%'/fields[NOT lc(attr)=~'h'].name"}%"
    type="string"
    format=" *$item* "
    separator=" | "
}%%ENDSECTION{"header"}%

-- BenDugan - 06 Aug 2013
Topic revision: r1 - 06 Aug 2013, BenDugan
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback