Here is the solution...it is in shell scripting..thought it will help..
put the below line in a file(except ---start-- and ---end-- line) and give
some name say "test_log.ksh"
----------start-----------------------
#!/bin/ksh
file_name=$1
if [[ -f path.txt ]] ; then
rm ./path.txt
fi
if [[ -f ./result.txt ]]; then
rm ./result.txt
fi
for name in `cat $file_name | sort | awk -F , '{print $1" "}' | uniq`; do
path=`grep $name $file_name | awk -F , '{print $NF}' | tr -d " " `
echo $path | tr " " "-" >> ./path.txt
done
cat ./path.txt | grep -v ^$ | sort | awk -F "-" '{print $1 "-" $2 "-" $3}' |
uniq > ./uniq.txt
for i in `cat ./uniq.txt`; do
count=`grep $i ./path.txt | wc -l`
echo $i $count >> ./result.txt
done
cat ./result.txt
---------------------end-----------------------
now put the data into another file say log.txt
and after that run using "./test_log.ksh log.txt"
to run this on window you need some tool which can interpret unix cmd to
window.
Sumit.
On Mon, Jul 25, 2011 at 7:05 PM, Saravanan T <[email protected]>wrote:
>
> How about a multidimensional hashing with keys as Webpage?
>
>
> On Mon, Jul 25, 2011 at 5:32 PM, Sandeep Jain <[email protected]>wrote:
>
>> This is similar to Frequent Pattern algorithms studied under data mining.
>> You may refer FP Growth tree.
>>
>>
>> Regards,
>> Sandeep Jain
>>
>>
>>
>>
>> On Mon, Jul 25, 2011 at 3:46 PM, sravanreddy001 <[email protected]
>> > wrote:
>>
>>> how about traversing the list once.. but.. looking at the user level.
>>> now.. we make a hashtable kind of entry.. adding 1 to the count for each
>>> of the combinations that comes in.
>>>
>>> if the logs are tricky.. like.. joe's 3rd page comes after sam's 1st page
>>> in the log.
>>>
>>> then.. the logs first have to be arranged in as per the user.. which
>>> takes some time for sorting.. and then following the above approach.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msg/algogeeks/-/SimPOhEme6kJ.
>>>
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.