9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies
2. Post Here to Contact Site Administrators and Moderators
HI Everyone,
I have below source file
AAA|NAME1|ADDRESS1|300.20
BBB|NAME2|ADDRESS2|400.31
CCC|NAME3|ADDRESS3|300.34
I have requirement where I need to sum up fourth field in above fixed width pipe delimited flat file. When I use below code, it gives me value 1001.00
But I am expecting... (1 Reply)
Discussion started by: patricjemmy6
1 Replies
3. Shell Programming and Scripting
I have 2 files say tp1.txt and tp2.txt having following data
cat tp1.txt
abc,2.20,IN20
acb,3.15,DN10
bca,3,RD10
cat tp2.txt
alv,1.00,IN20
aaa,4.05,DD10
abb,5.50,RD12
i want to compare the values on 2nd field of both the file, if value of first tp1.txt is greater than value... (3 Replies)
Discussion started by: ranabhavish
3 Replies
4. Shell Programming and Scripting
Hi Friends,
This is my last post for today.
My input file is
chr1 100 200
chr1 123 300
chr1 300 400
chr1 420 520
chr10 132344343 132348674
When I try using this command
awk '{v=($3+$2)/2; print $0"\t"v}' 1
This is my output
chr1 100 200 150
chr1 123 300 211.5 (2 Replies)
Discussion started by: jacobs.smith
2 Replies
5. Shell Programming and Scripting
Hi All,
In my script I've written like this-
c=$( expr 100 / 3);echo $c
The output coming is 33. but I want to see 33.33, decimal values too. How to get that?
Thanks,
Naresh (3 Replies)
Discussion started by: NARESH1302
3 Replies
6. Shell Programming and Scripting
Hi!!!
I have n decimal numbers in column:
1.23
3.45
5.16
.
.
.
How to do arithmetic sum of theese numbers???
Thanks!!!:D (4 Replies)
Discussion started by: tdev457
4 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a small requirement where i need to sum up a column in a text file.
Input file
66ab 000000 534385 -00000106350.00
66cd 000000 534485 -00013364511.00
66ad 000000 534485 -00000426548.00
672a 000000 534485 000000650339.82... (5 Replies)
Discussion started by: pssandeep
5 Replies
8. Shell Programming and Scripting
Hi guys I'm trying to print average of 2 columns.
awk '{print ($1+$2)/2}' file.txt
Its printing average but not giving decimal values
its giving 3.05521e+08 instead of 305521....
I tried %f to print float values but not quiet connected
Could you help plz:confused: (5 Replies)
Discussion started by: repinementer
5 Replies
9. UNIX for Advanced & Expert Users
Hi All,
Is there any command which can convert binary decimal coded values to ascii values...
i have bcd values like below
оооооооооооо0о-- -v -
Pls suggest a way to convert this.
Thanks,
Deepti.Gaur (3 Replies)
Discussion started by: gaur.deepti
3 Replies