10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
The awk below executes and is close (producing the first 4 columns in desired). However, when I add the sum of $7, I get nothing returned. Basically, I am trying to combine all the matching $4 in f1 and output them with the average of $7 in each match. Thank you :).
f1
... (2 Replies)
Discussion started by: cmccabe
2 Replies
2. Shell Programming and Scripting
How to sum up and print into the next line the total SUM.
]$ cat hhhh
aaa1a 1
aaa1g 2
aaa1f 3
baa4f 3
baa4d 4
baa4s 4
cddg1 3
cddg3 4
cddfg 1
$ cat hhhh|awk ' {sum+=$2} END {print sum}'
25
Desire output:
aaa1a 1 (13 Replies)
Discussion started by: kenshinhimura
13 Replies
3. Shell Programming and Scripting
I have the following file
299899 chrX_299716_300082 196 78.2903 299991 chrX_299982_300000 18.2538 Tajd:0.745591 FayWu:-0.245701 T2:1.45
299899 chrX_299716_300082 196 78.2903 299991 chrX_299982_300000 18.2538 Tajd:0.745591 FayWu:-0.245701 T2:0.283
311027 chrX_310892_311162 300 91.6452... (2 Replies)
Discussion started by: jfern
2 Replies
4. Shell Programming and Scripting
I have a file that I need to add 3 new lines of text for every line in the file - when I attempt the sed scripting below I keep getting 'command garbled' errors. Any suggestions would be greatly appreciated
#!/bin/ksh
list=`cat /export/home/list`
for i in $list
do
sed ' a \... (7 Replies)
Discussion started by: bjdamon
7 Replies
5. UNIX for Dummies Questions & Answers
Hello All,
this is my first post so I don't know if I am doing this right.
I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file.
As an example:
- the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies
6. Shell Programming and Scripting
hi,
i have two files.
file1.sh
echo "unix"
echo "linux"
file2.sh
echo "unix linux forums"
now the output i need is
$./file2.sh
unix linux forums (3 Replies)
Discussion started by: snreddy_gopu
3 Replies
7. Shell Programming and Scripting
Hi everyone,
I have a program that generates logs that contains sections like this:
IMAGE INPUT
81 0 0.995 2449470 0 1726 368 1 0.0635 0.3291
82 0 1.001 2448013 0 1666 365 1 0.0649 0.3235
83 0 1.009 2444822 0 1697 371 1 ... (3 Replies)
Discussion started by: euval
3 Replies
8. Shell Programming and Scripting
Hi,
I have an xml file
<Disp
x=y a=b
Disp/>
<Disp
q=1 w=2
Disp/>
.....
I want to add a new set in between like this for a set of 100 files.
<Disp
x=y a=b
Disp/>
<Disp
k=1 z=2
Disp/>
<Disp
q=1 w=2 (7 Replies)
Discussion started by: naga_5star
7 Replies
9. Shell Programming and Scripting
How to search string like: a and replace to
a
a
a
:
:
a
in a file with perl?
Thanks,
Grace (6 Replies)
Discussion started by: jinsh
6 Replies
10. Shell Programming and Scripting
Hi, i have a file like:
00:00 8
00:01 2
00:04 5
00:07 10
.
.
.
and i need to add the other minutes with value 0 and have a file like:
00:00 8
00:01 2
00:02 0
00:03 0
00:04 5
00:05 0
00:06 ... (13 Replies)
Discussion started by: Lestat
13 Replies