in reply to Re: How do I write NT perl script to search mult. dirs and output to a file?
in thread How do I write NT perl script to search mult. dirs and output to a file?
This prints the output to the text file with comma delimiters. Is it possible to print to the text file using ROWS, so that each MP3 file listing is on a separate line on the output? Better readability. Importing to excel is an option, but I would like to view in the text file.....
use strict; use File::Find; open (MP3, ">c:/perltest/mp3test.txt"); my @directories = (".", "c:/"); my @foundfiles; # Here, we collect all .mp3 files below each directory in @directories # and put them into @foundfiles find( sub { push @foundfiles, $File::Find::name if /\.mp3$/ }, @direct +ories ); # and output them all print join("\n", @foundfiles), "\n"; $, = ','; $/ = "\n"; print MP3 ("\n", @foundfiles), "\n"; close (MP3);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(Ovid) Re(3): How do I write NT perl script to search mult. dirs and output to a file?
by Ovid (Cardinal) on Dec 26, 2001 at 22:50 UTC | |
by Rich36 (Chaplain) on Dec 26, 2001 at 23:22 UTC | |
by rallen11 (Initiate) on Jan 02, 2002 at 20:40 UTC | |
by rallen11 (Initiate) on Jan 02, 2002 at 21:05 UTC |