#!/usr/local/bin/perl -w # splits a file - wordlist.html - into 16 word list files # for use in corpus.p $file = "/home/mackay/dasher/wordlist.html" ; $o = "DICT/d" ; $N=16; eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; open ( F , "< $file" ) ; while(){ # s/^\s+// ; # next if ( /^#/ ) ; ($word , $n ) = split ; $s[$n] .= $word."\n" ; } for ( $n = 0 ; $n <= $N ; $n ++ ) { $thisfile = $o.$n ; open ( O , "> $thisfile" ) ; print O $s[$n] ; close ( O ) ; }