> I appreciate the input on my recent post for comparing apples
> and oranges. Got it working great! Thanks. Now for some more food.
>
> I have a directory: food. In the directory, there are three
> files: apple, carrot, pecan. Each file has three descriptions
How are the descriptions formatted ?
Apple.txt:
Fruit
Red
Round
Here's a qucik and dirty way. Obviously you'd probably want to do lot more my's in
there and probably functions instead of backtick executions. But that will give you a
basic outline of what needs done.
If this isn't on unix the stuff in the backticks probably won't do you much good
because windows stinks.
@list = ();
@files = `ls food`;
foreach $file(@files) {
my @content = `cat food/$file`;
$file .= ":";
foreach $line(@content) {
$file .= "$line\:";
}
$file =~ s/\:$//;
push(@list, $file);
}
Hope that helps
Dan
> each. Apple has: fruit red round (as its three descriptions).
> Carrot has: vegetable orange long. Pecan
> has: nut brown oval.
>
> I would like a script that creates an array from the food
> directory - apple:fruit:red:round . The next line would be
> carrot:vegetable:orange:long . The third line would
> pecan:nut:brown:oval .
>
> Thanks.
>
> Bob Williams
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]