esolm has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # ingramid.pl use warnings; use strict; my @tempfile; my $file; my $ingramdir = "d:/ingram/ingramprc"; opendir(DIR, $ingramdir) or die "can't open $ingramdir: $!"; while (defined($file = readdir(DIR))) { print "$file\n"; open ingramoldfile, "d:/ingram/ingramprc/$file"; while (<ingramoldfile>){ chomp $_; push @tempfile, "$_\t$file\n"; } close ingramoldfile; } open ingramnew, ">d:/ingram/ingramprc/ingramall.txt"; print ingramnew @tempfile; close ingramnew; closedir(DIR);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: parse filenames
by lshatzer (Friar) on Apr 12, 2002 at 16:36 UTC | |
|
Re: parse filenames
by trs80 (Priest) on Apr 12, 2002 at 16:42 UTC | |
by CukiMnstr (Deacon) on Apr 12, 2002 at 17:28 UTC | |
by ehdonhon (Curate) on Apr 12, 2002 at 19:12 UTC | |
|
Re: parse filenames
by snafu (Chaplain) on Apr 12, 2002 at 19:20 UTC | |
|
Re: parse filenames
by Anonymous Monk on Apr 13, 2002 at 00:37 UTC |