but instead of putting the filename after the -p option i would like to be able to put in a directory name such as:
/pipermail or,
/Glamorgan
and then the output would display the number of access to that specific director and not the whole file.

The logfile which I am processing contains the following data (just a sample as it contains many entries some with /pipermail and somewith /Glamorgan)