Help with extract info if fulfill condition required
Input file (4 DATA record shown in this case):
Desired output file:
Condition required:
1. The first column info of desired output file is extracted from the line shown "VERSION" and extract the content after GI:;
2. The second column info of desired output file is extracted from the line that shown "/length="XXX"" after "length" word;
3. If first column info of desired output file is available but lack of column 2 info. Just put a "-" and print in desired output file;
Command try:
The command I try fail to give my desired output result
I was thinking to use "//" as field separator of each record.
Thanks for any advice.
---------- Post updated at 09:01 PM ---------- Previous update was at 04:54 AM ----------
Is there any advice or hints provided to solve my doubt?
I'm still stuck at solving this problem
Thanks in advance!
Last edited by perl_beginner; 05-22-2012 at 01:39 PM..
a simple question,
how can i use cut (after using grep) to extract the last four digits on a line.
so say i had a string http://blabla:9020, how would I extract the port??
-Fez (4 Replies)
Hi
i have a variable with lots of tokens seperated with spaces.
e.g VAR="ABC DEF GHSD GHQS TUTSD JHDTQ QDHQ CDQKDGQ WQUTQD DQUTQD DQJGDQ QDTQD WDQUTQDU QDUGQD QDJGQD DQUTDUQ QDUIDTQ"
i want to separate all of the above tokens and call a script with each of the token e.g sh script.sh <TOKEN>... (4 Replies)
Anyone have a better idea to automate extraction of info like ...
"uname"
"ifconfig"
"ps efl"
"netstat -ao"
etc.
from several hundred aix, solaris, red hat boxes? without logging into each box and manually performing these tasks and dumping them to individual files?
thanks for any input (1 Reply)
Hi All ,
I am wanted to know the #of thread ( Kernal & User ) created by the Process
i was looking into the prstat
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
994 httpd 126M 99M sleep 58 0 1:11.25 2.4% ns-httpd/33
997 httpd 114M 86M sleep 58 0 0:40.02 2.7% ns-httpd/22
995... (0 Replies)
Hi
I have a file which consists of a number in the square brackets, followed by the blank line, then several lines which describe this number. This pattern is repeated several thousands time. The number in the brackets and the decription of it is unique. For example:
ASRVSERV=1241GD;... (2 Replies)
I have some input file, which contains some lines which are comma separated. Eg.
a,b,id=999],d
d,f,g,id=345],x
x,y,x,s,id=677],y
I run a loop to read the lines one by one. What i want is to extract the value on the right of id=. I cannot do it by Awk, since the column number is not fixed.... (5 Replies)
Hi,
I issued the following command on my solaris 10 and got the following info.
prstat -Z
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
1344 oracle 4872M 2392M sleep 59 0 145:49:50 0.1% oracle/1
17523 oracle 3976K 3672K cpu18 59 0 0:00:04 0.1% prstat/1
1550 oracle 3276M... (1 Reply)
I have a if condition it checks its pid exist it means it is running, otherwise not running.
I am checking with ps
x=`ps -fu myuserid|grep java| |grep -v grep | awk '{print $2}'`
if
then ............
Above code is giving integer error, because currently process of java is... (4 Replies)
Hi guys, new to this forum. I am currently trying to extract the times from pinging a domain and list the top 3 and then also do the opposite i.e. list the bottom 3.
so if I had this as a ping result (the bold part is what I want):
64 bytes from 193.120.166.90: icmp_seq=10 ttl=128 time=34.8... (5 Replies)