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.
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
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.
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
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 /\.
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$/, $_){
> $
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`=~/"(.*)"/
--
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
}
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
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
10 matches
Mail list logo