#!/usr/bin/env python
import string
fd=open("uss.log")
"""
sum = 0
for line in fd:
if line.strip():
line=line.rstrip()
p=line.split()
mem = string.atoi(p[3][:-1])
sum = sum + mem
print "PSS memory:%d KiB" % sum
"""
for line in fd:
line=line.rstrip()
p = line.split()
p = "|=." + "|=.".join(p) + "|"
print p
求第四列数据的和:
86 41344K 39844K 21631K 17664K system_server
218 36320K 36320K 18802K 15464K com.android.launcher
160 27180K 27180K 11018K 8640K com.pateo.VoiceRecognition
508 25868K 25868K 10701K 9336K com.autonavi.xmgd.activity
546 27388K 27388K 9514K 6500K com.pateo.tracking
53 21800K 21800K 5439K 3344K zygote
156 19940K 19940K 4637K 3216K com.android.phone
206 18100K 18100K 3676K 2700K android.process.media
518 17740K 17740K 3236K 2232K cn.com.pateo.weather
293 17432K 17432K 3079K 1980K com.android.calendar
268 17192K 17192K 2980K 2068K com.android.navi.navireceiver
554 17272K 17272K 2850K 1728K com.android.mms
185 16136K 16136K 2635K 1808K android.ttsservice
388 16592K 16592K 2459K 1400K com.pateo.music
588 15804K 15804K 2092K 1244K com.android.login
581 15584K 15584K 2016K 1208K com.android.SmartLauncher
501 15556K 15556K 1965K 1156K pateo.webservice
531 15608K 15608K 1895K 972K com.pateo.audiowidget
540 15336K 15336K 1887K 1056K com.android.updater
54 4404K 4404K 1582K 1344K /system/bin/mediaserver
564 2164K 2164K 1481K 1388K /system/bin/bt_server
602 644K 644K 436K 428K ./procrank
55 748K 748K 306K 224K /system/bin/dbus-daemon
45 700K 700K 246K 224K /system/bin/rild
46 644K 644K 203K 184K /system/bin/canbusd
1 208K 208K 188K 188K /init
48 408K 408K 158K 148K /system/bin/vold
44 348K 348K 151K 144K /system/bin/sh
462 156K 156K 144K 144K /sbin/adbd
50 516K 516K 139K 124K /system/bin/sigsvrd
49 128K 128K 124K 124K /system/bin/mountd
57 328K 328K 104K 96K /system/bin/installd
47 276K 276K 87K 80K /system/bin/servicemanager
485 284K 284K 84K 76K /system/bin/debuggerd
59 256K 256K 71K 64K /data/bin/telnetd