Re: opening a list of files to process error

2005-05-03 Thread John W. Krahn
S E wrote: Hello, Hello, I've been using the following snippet of code to create a list of files (received from external clients) to be processed, interrogate the files for the client's id, confirm the id against the database and then rename the files with using the client id in a unix environment.

opening a list of files to process error

2005-05-03 Thread S E
Hello, I've been using the following snippet of code to create a list of files (received from external clients) to be processed, interrogate the files for the client's id, confirm the id against the database and then rename the files with using the client id in a unix environment. open(FILE_LI

Re: opening a list of files

2002-09-25 Thread Jeff 'japhy' Pinyan
On Sep 25, Adriano Allora said: >use Text::ParseWords; Why are you using this module if you're not ACTUALLY using it? >$folder = "pathname"; >opendir(KART, $folder); >foreach (readdir(KART)){ > if(grep /\.txt$/, $_){ You probably just want if (/\.txt$/) { ... } here. It's simpler.

Re: opening a list of files

2002-09-25 Thread Rohit Mishra-R53658
I dont know why but in my case also foreach ( readdir(...) ) didnt work. try while( $eachfile = readdir( KART ){ . } This worked in my case. -Rohit Adriano Allora wrote: > Hi to all, > I need a script to open all the files in a directory and count all the > words of them, but it do

Re: opening a list of files

2002-09-25 Thread Felix Geerinckx
on Wed, 25 Sep 2002 10:13:45 GMT, [EMAIL PROTECTED] (Adriano Allora) wrote: > Hi to all, > I need a script to open all the files in a directory and count all > the words of them, but it doesn't work: > $folder = "pathname"; > opendir(KART, $folder); > foreach (readdir(KART)){ > if(grep /\.

Re: opening a list of files

2002-09-25 Thread John W. Krahn
Adriano Allora wrote: > > Hi to all, Hello, > I need a script to open all the files in a directory and count all the > words of them, but it doesn't work: > > use Text::ParseWords; > $folder = "pathname"; > opendir(KART, $folder); > foreach (readdir(KART)){ > if(grep /\.txt$/, $_){ > $

Re: opening a list of files

2002-09-25 Thread Robert Rendler
Arg!! Sorry, I really should have read the question more carefully. while ($file = ) { open FH, $file or die $!; local $total; while () { $total += split /\S+/, $_ ; --$total; } print "In the file $file there are $total words\n"; } -- print`$^Xdoc -qj`=~/"(.*)"/ --

Re: opening a list of files

2002-09-25 Thread Robert Rendler
On Wed, 25 Sep 2002 20:32:07 +1000 Robert Rendler <[EMAIL PROTECTED]> wrote: > I don't know how accurate this may be: Bit of testing and it seems kinda accurate, shortened it anyways. while () { open FH, $_ or die $!; while () { $total += scalar split /\S+/, $_; --$total }

Re: opening a list of files

2002-09-25 Thread Robert Rendler
On Wed, 25 Sep 2002 12:13:45 +0200 Adriano Allora <[EMAIL PROTECTED]> wrote: > Hi to all, > I need a script to open all the files in a directory and count all the > words of them, but it doesn't work: > > > use Text::ParseWords; > $folder = "pathname"; > opendir(KART, $folder); > foreach (readd

opening a list of files

2002-09-25 Thread Adriano Allora
Hi to all, I need a script to open all the files in a directory and count all the words of them, but it doesn't work: use Text::ParseWords; $folder = "pathname"; opendir(KART, $folder); foreach (readdir(KART)){ if(grep /\.txt$/, $_){ $filename = "$_"; open(INPUT, $filename); this