...

View Full Version : Simple parsing script help



pepsi_max2k
06-24-2008, 01:30 PM
Hey all, I have a simple script I'd like modifying, just figure someone here might be able to help before I try and figure it all out myself.

Original:

lynx -source "http://a_web_page" | grep "TrCall(\"3\"" | awk {'print $3" "$4" "$6'} | sed -e "s/\"//g" -e "s/,//g" > /tmp/a_log_file

Run on a page containing, among other things,


<script type="text/javascript">document.write(TrCall("2", "24.06.08 13:55", "", "019041111111", "", "0", "1", "0:00"));</script>
<script type="text/javascript">document.write(TrCall("3", "24.06.08 13:54", "", "10000", "0", "0", "1", "0:01"));</script>

Gives me a file with:


24.06.08 13:54 10000

What I'd like is, aswell as grabbing the stats based on the first quoted number "1", "2" or "3" (in this case only 3 is recorded), I'd like to do it based on the 6th quoted number too (bold in the above text), which is either "", "0" or "1". I'd like to record only those with "".

Thanks to anyone who can advise how :thumbsup:


UPDATE:
There's gotta be a more efficient way than this?

grep "TrCall(\"3\"" | awk {'print $3" "$4" "$6" "$8'} | grep "\"\"" | sed -e "s/\"//g" -e "s/,//g"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum