Here is another solution that uses the WebDNA shell =command on *nix
systems to use ruby:
[shell]ruby -e "print =%w['[text_var]'].uniq.join(' ')"[/shell]
This worked for me and =is only one line.
It calls the ruby interpreter, passing the -e =switch to execute the
ruby command in doublequotes, converts the =words of the string to
members of an array ([text_var] is expressed =before calling the
command line), finds the unique array members and =joins them with a
space.
It's not WebDNA doing the heavy =lifting and adds a dependency you may
not want, but it's only one =line.
Bill
On Tue, Aug 25, 2009 at 1:27 PM, =System
Administrator<bharrington@1choicerealty.co=m> wrote:thanks Frank... you're = awesome.here's it =at work (before <hr> is text before =conversion)http://www.etrader.tv/uniqu=ewords.tplOn Aug 25, =2009, at 1:20 PM, Frank Nordberg wrote:Woops, I noticed a bug right away. This is better, =although I still won'tpromise it'll work without some =tweaking:[ListWords Words=3Dtext with =some repeated words with repeated =words][!][/!][ShowIf =[index]=3D1][!][/!][Text]usedwords=3D_[word]_[/Text][!][/!][word] =[!][/!][/ShowIf][!][/!][HideIf =[usedwords]^_[word]_][!][/!] =[word][!][/!][/HideIf][!][/!][Text]usedwords=3D[usedwords]_[word]_[/Text][!][/!][/ListWords]and:[ListWords Words=3Dtext with =some repeated words with repeated =words][!][/!][ShowIf =[index]=3D1][!][/!][Text]usedwords=3D_[word_][/Text][!][/!][/ShowIf][!][/!][ShowIf =[usedwords]^_[word]_][!][/!][word] =[!][/!][/ShowIf][!][/!][Text]usedwords=3D[usedwords]_[word]_[/Text][!][/!][/ListWords]For a more compact script you =can remove the [!] and [/!] but then =you'dalso have to remove all the line shifts in the script =making it a it trickyto read and =debug.Frank =Nordberghttp://www.musicaviva.comhttp:/=/stores.ebay.com/Nordbergs-Music-Store?refid=3Dstore<=/blockquote>---------------------------------------------------------This message is sent to you because you are subscribed =tothe mailing list <talk@webdna.us>.To =unsubscribe, E-mail to: <talk-leave@webdna.us>archives: http://mail.webdna.us/l=ist/talk@webdna.usold archives: http://dev.webdna.us/TalkLi=stArchive/Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288=---------------------------------------------------------This message is sent to you =because you are subscribed tothe mailing list <talk@webdna.us>.To unsubscribe, E-mail to: <talk-leave@webdna.us> archives: http://mail.webdna.us/l=ist/talk@webdna.usold =archives: http://dev.webdna.us/TalkLi=stArchive/Bug Reporting: =http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288=-------------------------------------------=--------------
This message is sent to you because you are subscribed =to
the mailing list <talk@webdna.us>.
To unsubscribe, =E-mail to: <talk-leave@webdna.us>
archives=: http://mail.webdna.us/l=ist/talk@webdna.us
old archives: http://dev.webdna.us/TalkLi=stArchive/
Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288=
|
Here is another solution that uses the WebDNA shell =command on *nix
systems to use ruby:
[shell]ruby -e "print =%w['[text_var]'].uniq.join(' ')"[/shell]
This worked for me and =is only one line.
It calls the ruby interpreter, passing the -e =switch to execute the
ruby command in doublequotes, converts the =words of the string to
members of an array ([text_var] is expressed =before calling the
command line), finds the unique array members and =joins them with a
space.
It's not WebDNA doing the heavy =lifting and adds a dependency you may
not want, but it's only one =line.
Bill
On Tue, Aug 25, 2009 at 1:27 PM, =System
Administrator<bharrington@1choicerealty.co=m> wrote:thanks Frank... you're = awesome.here's it =at work (before <hr> is text before =conversion)http://www.etrader.tv/uniqu=ewords.tplOn Aug 25, =2009, at 1:20 PM, Frank Nordberg wrote:Woops, I noticed a bug right away. This is better, =although I still won'tpromise it'll work without some =tweaking:[ListWords Words=3Dtext with =some repeated words with repeated =words][!][/!][ShowIf =[index]=3D1][!][/!][text]usedwords=3D_[word]_[/Text][!][/!][word] =[!][/!][/ShowIf][!][/!][HideIf =[usedwords]^_[word]_][!][/!] =[word][!][/!][/HideIf][!][/!][text]usedwords=3D[usedwords]_[word]_[/Text][!][/!][/ListWords]and:[ListWords Words=3Dtext with =some repeated words with repeated =words][!][/!][ShowIf =[index]=3D1][!][/!][text]usedwords=3D_[word_][/Text][!][/!][/ShowIf][!][/!][ShowIf =[usedwords]^_[word]_][!][/!][word] =[!][/!][/ShowIf][!][/!][text]usedwords=3D[usedwords]_[word]_[/Text][!][/!][/ListWords]For a more compact script you =can remove the [!] and [/!] but then =you'dalso have to remove all the line shifts in the script =making it a it trickyto read and =debug.Frank =Nordberghttp://www.musicaviva.comhttp:/=/stores.ebay.com/Nordbergs-Music-Store?refid=3Dstore<=/blockquote>---------------------------------------------------------This message is sent to you because you are subscribed =tothe mailing list <talk@webdna.us>.To =unsubscribe, E-mail to: <talk-leave@webdna.us>archives: http://mail.webdna.us/l=ist/talk@webdna.usold archives: http://dev.webdna.us/TalkLi=stArchive/Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288=---------------------------------------------------------This message is sent to you =because you are subscribed tothe mailing list <talk@webdna.us>.To unsubscribe, E-mail to: <talk-leave@webdna.us> archives: http://mail.webdna.us/l=ist/talk@webdna.usold =archives: http://dev.webdna.us/TalkLi=stArchive/Bug Reporting: =http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288=-------------------------------------------=--------------
This message is sent to you because you are subscribed =to
the mailing list <talk@webdna.us>.
To unsubscribe, =E-mail to: <talk-leave@webdna.us>
archives=: http://mail.webdna.us/l=ist/talk@webdna.us
old archives: http://dev.webdna.us/TalkLi=stArchive/
Bug Reporting: http://forum.webdna.us/eucabb.html?page=3Dtopics&category=3D288=
DOWNLOAD WEBDNA NOW!
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...