Tags:
create new tag
view all tags

Question

How can I transform a csv list to a bulleted item list using SpreadSheetPlugin

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: SpreadSheetPlugin, DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser: Firefox 1.x
Categories: Plugins

I try to display the elements of a csv list as a bullet list but I can't get it work. I expect the csv list to be stored in a variable.

Take the the WEBFORMS variable from the Sandbox web:

WEBFORMS = WebForm, ContactForm, ItemToDoForm, TestTextAreaForm, WebPreferencesForm, TutorialTableForm, BackslashBrokenForm, ChangeRequestForm, ChangeProposalForm, TranslationForm, TestFormWithAccents, GathererForm, UseCaseForm, ProjectWeeklyReportForm, SelectMultiForm, MultipleCheckboxTestForm, BeatlesFanForm, NewArtcleForm, MKResearchForm, KnownErrorForm, CustomersProjectTemplateProjectMinutesFormPageToUse, CustomersProjectTemplateProjectAgendaFormPageToUse, CompilerInfoMapForm, SampleForm

This is what I want to have:

Here is what I'm trying to do:

%CALC{$TRANSLATE($LISTMAP($CHAR(9)* $item, %VAR{"WEBFORMS" web="Sandbox"}%), $comma, $CHAR(10))}%

The result is, however:

* WebForm * ContactForm * ItemToDoForm * TestTextAreaForm * WebPreferencesForm * TutorialTableForm * BackslashBrokenForm * ChangeRequestForm * ChangeProposalForm * TranslationForm * TestFormWithAccents * GathererForm * UseCaseForm * ProjectWeeklyReportForm * SelectMultiForm * MultipleCheckboxTestForm * BeatlesFanForm * NewArtcleForm * MKResearchForm * KnownErrorForm * CustomersProjectTemplateProjectMinutesFormPageToUse * CustomersProjectTemplateProjectAgendaFormPageToUse * CompilerInfoMapForm * SampleForm

What would be the correct way to get those bullets?

-- AttilaPeter - 16 Sep 2005

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.

You are on the right track. There is a problem because the parser strips leading whitespace. It works if you use $LISTJOIN to join the lines with newlines. Here are two options:

Use just a $LISTJOIN:

Use $LISTJOIN and $LISTMAP:

View raw text

-- PeterThoeny - 20 Sep 2005

That was I was looking for... I did not have the newest version of the plugin so the LISTJOIN function was missing from my installation :-(.

Thanks!

-- AttilaPeter - 20 Sep 2005

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2005-09-20 - AttilaPeter
 
  • 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.