Utilisateur:Kipmaster/demander-format.pl
Apparence
#!/usr/bin/perl $intext = 0 ; $titlebien = 0 ; open(LISTEFREQ, "</tmp/liens-compte"); # open for input my(@listefreq) = <LISTEFREQ>; # read file into list $index = 0 ; # la première ligne (0) casse tout $motetfreq = $listefreq[$index] ; if ( $motetfreq =~ / *(\d+) (.*)/ ) { $freq = $1 ; $mot_ref = "$2\n" ; } while (<>) { $ligne = $_ ; # print "mot1 : $ligne mot2 : $mot_ref" ; while ( $mot_ref lt $ligne ) { $index++ ; $motetfreq = $listefreq[$index] ; if ( $motetfreq =~ / *(\d+) (.*)$/ ) { $freq = $1 ; $mot_ref = "$2\n" ; } } # $frequence = `fgrep -c "$ligne" /home/cmillet/wikitruks/xml/work/liens` ; # chop( $frequence) ; chop ($ligne) ; print "$freq [[$ligne]]\n" ; } close(LISTEFREQ);