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, 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 * 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 have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list 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

 
Topic revision: r3 - 2005-09-20 - AttilaPeter
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.