file's manipulation

2001-07-26 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I ask two questions: 1) how can i do to add a line in the begining of a file ? 2) how can i do to delete lines after a character string which is in a line ? thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

code doesn't work

2001-07-26 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi, Can anybody tell me why this code doesn't work ? #!/usr/bin/perl -w open(FICHIER,"rdn1.html"); open (TEMP,">>temp.html"); while() { print TEMP $_ until ($_ =~m/ancre/); } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

last line

2001-07-27 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! How can i do to delete the last line of a file ? Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

code doesn't work

2001-07-27 Thread COLLINEAU Franck FTRD/DMI/TAM
this code doesn't work: @temp=; $temp[2]=""; $temp[3]=""; $temp[4]=""; $temp[5]=""; print TEMP @temp; The error message is "Use of uninitialized value in print at 01_info.pl line 25, line 1." can anybody help me ? Franck -- To unsubscribe, e-

deleting lines

2001-07-27 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I would like too delete the 2nd, 3rd, 4, and 5 lines of a file. how can i do ? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

readdir

2001-07-27 Thread COLLINEAU Franck FTRD/DMI/TAM
I have a problem with my code: #!/usr/bin/perl -w opendir (LMI,"lmi") || die "impossible d'ouvrir lmi: $!"; $chaine="BEGIN PAPIER"; while($fichier=readdir LMI) { open (FICHIER,"lmi/$fichier") || die "impossible d'ouvrir $fichier: !$\n"; open(TEMP,">>temp.htm")|| die "impossible d

counting files of a directory

2001-07-30 Thread COLLINEAU Franck FTRD/DMI/TAM
Hello! Is there a function which count the number of files in a directory ? Thanks Franck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Problem...

2001-07-30 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I have a problem with that code: #!/usr/bin/perl -w use File::Copy; opendir (LMI,"lmi") || die "impossible d'ouvrir lmi: $!"; $chaine='BEGIN PAPIER'; while($fichier=readdir LMI) { next if ($fichier eq '.' or $fichier eq '..'); open (FICHIER,"lmi/$fichier") || die "impossi

copying file

2001-07-30 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I want to copy "temp.htm" to "aol.htm" Why doesn't this code work ? #!/usr/bin/perl -w open(TEMP, "+>temp.htm"); open(FICHIER,">lmi/aol.htm"); use File::Copy; copy("temp.htm","lmi/aol.htm") ; close FICHIER; close TEMP; Thanks Franck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

substitution

2001-07-31 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I have a file where there is a line whitch begans by the string "". I would like to remove the string "" by nothing. How can i do ? Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

module File::Copy

2001-07-31 Thread COLLINEAU Franck FTRD/DMI/TAM
Hello! I have a problem with this code: #!/usr/bin/perl -w use File::Copy; open (CONCAT,"lmi/concat.htm") || die "impossible d'ouvrir concat.htm: $!\n"; open (CONCAT2,">lmi/concat2.htm") || die "impossible d'ouvrir concat2.htm: $!\n"; while() { s///i; print (CONCAT2 $_); } close

inserting lines

2001-08-02 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! How can i do to insert several lines in the beginning of a existant file ? Thanks Franck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

number of line

2001-08-02 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I would like to store the number of a line whitch corresponds to a string. How can i do ? Thanks FRanck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

problem with concatenation

2001-08-03 Thread COLLINEAU Franck FTRD/DMI/TAM
Here is an extract of my code: 1>$chaine2=""; 2>$chaine3=""; 3>$chaine4=""; 4>for($i=0;$i<$cpt;$i++) 5>{ 6> $chaine2="\n"; 7> $chaine3=$titre[$i]; 8> $chaine4 = $chaine2.$chaine3; 9> print TEMP $chaine4; 10>} There is a problem with line 8; the message is :"Use of uniniti

TR: creating file

2001-09-24 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! > I have a file with a line that is "". > I would like to create a file with all the lines after the line > "___". > I don't know how to do that > > Thanks > > Franck > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

creating file

2001-09-24 Thread COLLINEAU Franck FTRD/DMI/TAM
> Hi! > > I have a file with a line that is "". > I would like to create a file with all the lines after the line > "___". > I don't know how to do that > > Thanks > > Franck > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

line with nothing

2001-09-24 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! How can i repair (with a regular expression) a line with nothing inside ? Thanks Franck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

deleting line

2001-09-25 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! How can i do to delete a line whitch contains a charcter string ? Thanks Franck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

extracting character string

2001-09-25 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! How can i do to extract a string between two others strings ? Thanks Franck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

the line whitch follows $_

2001-09-25 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I have the follwing code: while () { push @line, $_ if(m/^

Extraction

2001-10-01 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I have in a HTML file some lines like: Apple Expo renaît sur le Net Comparatif des fournisseurs d'accès : Wanadoo reprend son titre I would like to extract the strings: "

extraction

2001-10-02 Thread COLLINEAU Franck FTRD/DMI/TAM
I have wrote the following code: while() { print TEMP "$1\n" if(m/(< a href=\"\/rdn\?oid.*rub); } The finding lines are like that: "gqgfqsgdkg< a href="rdn?oiddsfhlhfdsrub=lhfdlhg" class sljdfsgkjfd" I only want to extract the underlined string. How can i do to stop the extraction

matching

2001-10-02 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I have wrote the following code: while () { if(m/(http:\/\/www.01net.com\/rdn?oid=[0-9].*&rub=[0-9].*)/ ) { print TEMP2 "$1\n" ; } } The matching doesn't work ! want to match for example : http://www.01net.com/rdn?oid=54682&rub=12456

Stat function

2001-11-20 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I have the following code: #!/usr/bin/perl -w open(FIC,">/home/collineau/Perl/Programmes/01_informatique/sauve/c0111_05.ht m") || die "Impossible d'ouvrir $!\n";; @tab = stat (FIC); print scalar localtime($tab[10]); The date of c0111_05.htm is november 5th 2001. But the print is now !

RE: writting in a file

2001-11-20 Thread COLLINEAU Franck FTRD/DMI/TAM
I'm sorry, I've found Thank you -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Envoyé : mardi 20 novembre 2001 15:18 À : COLLINEAU Franck FTRD/DMI Cc : [EMAIL PROTECTED] Objet : Re: writting in a file Should be print TEMP $_; On Tue, Nov 20, 2001 at 02:57:25PM +0

Number of week

2001-12-10 Thread COLLINEAU Franck FTRD/DMI/TAM
Greetings, How can i get the number of the week from localtime function ? Best regards, Franck -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Stat function

2001-12-10 Thread COLLINEAU Franck FTRD/DMI/TAM
Greetings, I have the following code: opendir (INFO,"l:/01_informatique") || die " impossible d'ouvrire le répertoire 01_informatique: $!"; while ($fic=readdir INFO) { if($fic=~/^c/) { @date=stat($fic); print "$date[7]\n"; } } close INFO;

RE: Stat function

2001-12-10 Thread COLLINEAU Franck FTRD/DMI/TAM
I have found Thanks -Message d'origine- De : COLLINEAU Franck FTRD/DMI [mailto:[EMAIL PROTECTED]] Envoyé : lundi 10 décembre 2001 11:08 À : '[EMAIL PROTECTED]' Objet : Stat function Greetings, I have the following code: opendir (INFO,"l:/01_informatique") || die " impossible d'ouvri

Permission denied - rename

2001-12-10 Thread COLLINEAU Franck FTRD/DMI/TAM
Hi! I 've written the code below. There is a problem with "rename": i have the message: "permission denied". Nevertheless, I have all the rights. What 's happen ? Franck ___ #!/usr/bin/perl -w $now=time; opendir (INFO,"l:/

RE: -d test file

2002-01-21 Thread COLLINEAU Franck FTRD/DMI/TAM
Title: RE: -d test file I've found. I have to put the absolute path. Is there a way without absolute path ? Franck -Message d'origine- De : COLLINEAU Franck FTRD/DMI [mailto:[EMAIL PROTECTED]] Envoyé : mardi 22 janvier 2002 08:15 À : [EMAIL PROTECTED] Objet : -d test file Greeti