I have a command to print out the top 5 most cpu intensive commands:
I would like to make a printout containing only the parsed file name.
So, I want to turn this:
Into this:
Note that '/usr/lib/xorg/Xorg -nolisten tcp :0 vt1 -keeptty -a' has been trimmed to say only 'Xorg'; I would like the file name itself with no command parameters at the end.
So far I have this:
I understand that I could just slap a cut command on the end of it and it's all fine:
ex.,
but I don't want to use anymore commands to complete this task; this command will be repeated every 1 second or so and printed out in my status bar, so I want it to be efficient. And I know that awk is powerful enough to do this; but I just don't seem to be able to do this all in one. I could parse the beginning of the filename but the end out be out of control. And vise-versa. I have a feeling it's something to do with '-F/' but how to incorporate the two?
Hi, I have a input file like this
TH2TH2867Y NOW33332106Yo You Baby
TH2TH3867Y NOW33332106No Way Out
TH2TH9867Y NOW33332106Can't find it
TJ2TJ2872N WOW33332017sure thing alas
TJ2TJ3872N WOW33332017the sky rocks
TJ2TJ4872N WOW33332017nothing else matters
TJ2TJ5872N WOW33332017you know... (1 Reply)
Hi, I have a input file like this
TH2TH2867Y NOW33332106Yo You Baby
TH2TH3867Y NOW33332106No Way Out
TH2TH9867Y NOW33332106Can't find it
TJ2TJ2872N WOW33332017sure thing alas
TJ2TJ3872N WOW33332017the sky rocks
TJ2TJ4872N WOW33332017nothing else matters ... (4 Replies)
Hi All,
I have a log file like this
E Mon Oct 06 00:17:08 2008 xxx2 cm:10614 fm_pi2_svc_iptv_purchase.c:149 1:pin_deferred_act:10601:11:169:1223245028:16
pi2_op_svc_iptv_purchase error
<location=PIN_ERRLOC_FM:5 class=PIN_ERRCLASS_SYSTEM_DETERMINATE:1... (10 Replies)
I don't necessary have a problem, as I have a solution. It is just that there may be a better solution.
GOAL: Part one: Parse data from a file using the "\" as a delimiter and extracting only the last delimiter. Part two: Parse same file and extract everything but the last delimited item.
... (8 Replies)
Hi,
I have a data set as shown below:
09e757fd,22727,2012-03-01,text1,text2,to
3fd0cae7,310,2012-03-01,text3,text4,to
3fd0cae7,310,2012-03-01,text3,text5,to
3fd0cae7,311,2012-03-01,text7,text10,cc
3fd0cae7,311,2012-03-01,text7,text11,to
3fd0cae7,312,2012-03-01,text8,text15,to... (3 Replies)
Hello guys,
please help me to make simple script for parsing passwd file.
I have many passwd files from our servers, named server1.pass, server2.pass etc..
so
for server in `ls *.pass`
i need to print these rows:
server1;root:!:0:0::/root:/usr/bin/ksh... (7 Replies)
Looking to parse a file to remove the duplicates and get only few fields and uniq rows.
input.tx
Loc (TC) ID : ssfad_fs
Serial : PIC002340098
... (8 Replies)