On Tue, 17 Jun 2003 13:58:35 +0200 Jonas Meurer <[EMAIL PROTECTED]> wrote:
> still, the hole workaround is not the best solution. the lists i > maintain are all in the style 'part1-part2-part3-...'. some without any > -, some with many. so i split the list in the parts, n=number of parts. > then i do 16/n, and every part gets as many chars as the result gives. > now the first run of a loop fills the acronym until 1*(16/n), the second > until 2*(16/n). so there will always result an acronym without the - but > with at least 16/n chars per part, if the part is long enough. here is > the algoritm script: > actual_list_lc=`echo $actual_list | awk '{print tolower($0)}'` > actual_list_id=`echo $actual_list_lc | > awk'{s="";n=split($0,a,/-/);c=16/n;for(i=1;i<=n;i++){s=s""substr(a[i],1,c > *i-length(s))};print tolower(s)}' > > if $actual_list has value "Argentina-Communicados" for example, > $actual_list_lc will be "argentina-communicados", and $actual_list_id > will have value "argentincommunic". What happens if an english speaking customer/friend creates another list on your host called "Argentine-Communications"?? G -- Gerald V. Livingston II Configure your Email to send TEXT ONLY -- See the following page: http://expita.com/nomime.html '74 Kombi (to be renamed - LifeSaver doesn't 'feel' right) '69 Type 1 - AirBall the Rolling Basket Case http://www.phorce1.com http://www.buskatiers.org ------------------------------------------------------ Mailman-Users mailing list [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ This message was sent to: [EMAIL PROTECTED] Unsubscribe or change your options at http://mail.python.org/mailman/options/mailman-users/archive%40jab.org