I currently have many log files for different webpages inside the folder /log/. The program allows the user to enter a month and then the grep function searches for it, the command i used is below:
grep -c "$month" ./log/*.log
This works and i can ascertain the number of matches, but I cannot find out how to format the name of the .log and the number of matches into two seperate columns. Kind of like:
I want it in two columns, kinda the same as in a table format, like in my original porst.
I tried putting a "\t" in the sed, whilst this spaced out the matches, they arent all aligned in a second column, due to the smaller file names.
Im thinking the 'printf' command may be better spacing the matches out into another column, though im having trouble putting it into the 'sed' sequence.