The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Outputting to table amatuer_lee_3 Shell Programming and Scripting 3 05-15-2008 08:15 PM
Help Inserting data in mysql table vadharah Shell Programming and Scripting 11 03-30-2008 09:26 AM
grep: outputting search strings tapmas Shell Programming and Scripting 3 03-10-2008 01:58 AM
List grep results slire UNIX for Dummies Questions & Answers 14 10-31-2006 08:42 AM
How to refine results of grep -p priceb Shell Programming and Scripting 2 06-28-2006 05:40 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-12-2008
Registered User
 

Join Date: May 2008
Posts: 2
outputting data in table from grep results

Hi all. I'm a real unix newbie and looking for some help on a shell scripting problem. I'm going the longest ways around everything but I'm getting there.
My next problem however has me stumped.
I have set up a program that takes inputs from a user for a particular month and year (and stores them in variables) then searches a list of hits files for these values.
The hits files all contain information on webpage visits, so the hits for adventure.html are stored in adventure.hits.
These hit files are made up of several columns:

103.45.155.82 Tue Nov 15 03:23:42 GMT 2006

My script so far will search all of those hits files for the specified month and year, so Nov 2006 for example, then outputs the results to a temporary file.
This temporary file records all the columns for the records matching the search criteria as well as listing the filename in the first column. like this:

adventure.hits:103.45.155.82 Tue Nov 15 03:23:42 GMT 2006

I need to now output a table to the terminal that shows data under headings like this:

Page Name - Hits - Unique Hits
adventure.hits 58 18
sports.hits 107 12

Any ideas how to go about this?
Thanks!
Reply With Quote
Forum Sponsor
  #2  
Old 05-12-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
If you are not doing this primarily for the learning, you should be aware that there is a metric godzillion web log analyzer packages out there, some of them very sophisticated. The first lesson would be don't reinvent what you can download.
Reply With Quote
  #3  
Old 05-12-2008
Registered User
 

Join Date: May 2008
Posts: 2
Sadly it is for academic purposes. So downloading anything is a no sadly.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0