10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
input:
chr1 1 2 3
chr1 1 2 4
chr1 2 4 5
chr2 3 6 9
chr2 3 6 10
Code:
awk '{a+=$4}END{for (i in a) print i,a}' input
Output:
chr112 7
chr236 19
chr124 5
Desired output:
chr1 1 2 7
chr2 3 6 19
chr1 2 4 5 (1 Reply)
Discussion started by: jacobs.smith
1 Replies
2. Solaris
i am using the command pkginfo -l | /usr/xpg4/bin/grep -e 'VENDOR' -e 'NAME' -e 'VERSION' >> /tmp/test1.txt in order to get name,vendor and version of the applications installed on Solaris machine.The output stored in test1.txt in as shown below:
NAME: Solaris Zones (Usr)
VERSION: ... (4 Replies)
Discussion started by: omkar.jadhav
4 Replies
3. Shell Programming and Scripting
I have a file some thing like this:
GN Name=YWHAB;
RC TISSUE=Keratinocyte;
RC TISSUE=Thymus;
CC -!- FUNCTION: Adapter protein implicated in the regulation of a large
CC spectrum of both general and specialized signaling pathways
GN Name=YWHAE;
RC TISSUE=Liver;
RC ... (13 Replies)
Discussion started by: raj_k
13 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
My requirement is to convert the rows to columns, please help me how to do in one command.
Ex: source file is having data like
ABC,XYZ,123,987,KKK,XXX,666
Need output like
ABC
XYZ
987
KKK
XXX
666
Regards,
Pavan. (3 Replies)
Discussion started by: madsongtel
3 Replies
5. Shell Programming and Scripting
a,b,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,bb,cc,dd,ee,ff,gg,hh,ii
a thru ii are digits and strings....
The awk needed....if coloumn 9 == i (coloumn 9 is string ), output the sum of x's(coloumn 22 ) in all records and sum of y's (coloumn 23 ) in all records in a file (records.txt).... (6 Replies)
Discussion started by: BrownBob
6 Replies
6. UNIX for Dummies Questions & Answers
I have 2 files,
file01= 7 columns, row unknown (but few)
file02= 7 columns, row unknown (but many)
now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there
e.g.
file 01
James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies
7. Shell Programming and Scripting
Hi,
suppose I have the following file and certain rows have missing columns,
how do i skip these rows and create an output file which has all the columns in it
E/N Ko_exp %err Ko_calc %err diff diff- diff+ 0.95
======== ======= ==== ======= ==== ===== ===== =====... (12 Replies)
Discussion started by: ramky79
12 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am wondering how to do this more efficiently than I am currently doing it:
I have these 3 columns
3315 E14 1
397 E14 2
321 E14 3
27 E14 4
7 E14 5
2 E14 6
But I like them to be displayed like this:
1 2 ... (5 Replies)
Discussion started by: danieladna
5 Replies
9. Shell Programming and Scripting
Hi All,
I would like to ask help on how can i achieve below output.
Inputfile:
Oct11,apa1-daily,01:25:01
Oct11,apa2-daily,01:45:23
Oct12,apa1-daily,02:30:11
Oct12,apa2-daily,01:55:01
Oct13,apa1-off,01:43:34
Oct13,apa2-off,01:22:04
Desired output:
Clients ... (3 Replies)
Discussion started by: mars101
3 Replies
10. Shell Programming and Scripting
I have got a file like this
003ABC00281020091005000100042.810001 ... (8 Replies)
Discussion started by: Maruti
8 Replies