You can loop through the files inside a directory like this:
FLDR="."
cd $FLDR
find . ! -name . -prune -type f | while read x; do
# this will print the filename
#echo $x
# To get the date
#ls -lt $x | awk '{print $6" "$7" "$8}'
# If the file is older than 6 months (not sure though), this will include the year. If not, this will include the time
# What you want maybe like this:
found=`awk '/Category/ {getline; print }' "$x"`
[ "$found" != "" ] && echo "$found,$x,"`ls -lt $x | awk '{print $6" "$7" "$8}'`
done
#!/usr/bin/perl
@files=glob("*.txt");
open FH,">out.txt";
foreach(@files){
open F,"<$_";
my $file=$_;
while(<F>){
print FH $file," line $.: ",$_ if /Toyota/;
}
close F;
}
close FH;