10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
In the below awk, I am trying to calculate percent for a given id. It is very close the problem is when the # being used in the calculation is zero. I am not sure how to code this condition into the awk as it happens frequently. The portion in italics was an attempt but that lead to an error. Thank... (13 Replies)
Discussion started by: cmccabe
13 Replies
2. Shell Programming and Scripting
I am trying to run the awk below. My question is when I split the input, then run anotherawk to perform a calculation using that splitas the input there are no issues. When I try to combine them the output is not correct, is the split not working or did I do it wrong? Thank you :).
input
... (8 Replies)
Discussion started by: cmccabe
8 Replies
3. Shell Programming and Scripting
I have a below snippet of code from my perl script and its causing a problem when the output of $lTAX is 0 (zero) its getting displayed as -0.00. I want output to be 0 not -0.00. Any help would be appreciated.
#!/usr/bin/perl
my $lTotA = 50.94;
my $lVatA = 8.49;
my $lAllocD;
my $lAdjNr =... (4 Replies)
Discussion started by: Devesh5683
4 Replies
4. Shell Programming and Scripting
#!/bin/sh
CURRENTSTATE=2
CSVCSTATE=2
LASTSTATECHANGE=8
CSVCSTATEAGE=5
if (($CURRENTSTATE==$CSVCSTATE))&&(($LASTSTATECHANGE>=$CSVCSTATEAGE))
echo GREAT
fi
returns:
./aff: line 12: syntax error near unexpected token `fi'
./aff: line 12: `fi'
what am i doing wrong here? (6 Replies)
Discussion started by: SkySmart
6 Replies
5. Programming
hi there again,
i need to do a simple division with my data with a number of rows. i think i wanted to have a simple output like this one:
col1 col2 col3
val1 val2 val1/val2
valn valm valn/valm
any suggestion is very much appreciated. thanks much. (2 Replies)
Discussion started by: ida1215
2 Replies
6. Shell Programming and Scripting
val=21
total=3250
echo "`echo "scale=2; $val*100/$total" | bc`"
Output:
.64
How do i show the output become "0.64" instead of ".64" ?? Someone can help? (1 Reply)
Discussion started by: alvin0618
1 Replies
7. Shell Programming and Scripting
I've gone through bunch of threads on time calculations but none of them helps on my problem
I've to get the time difference in HHMM format from following inputs
Input 1 :
01/08/2010 01:30
01/08/2010 03:20
Input 2 :
01/06/2010 22:00
01/07/2010 16:00
First input is easy but... (8 Replies)
Discussion started by: prash184u
8 Replies
8. Shell Programming and Scripting
Hi All,
can some body help me to script the below logic. Basically am facing
problem with float calculation. Also i need this to be done inside a single awk.
I tried lot of tuning but still nothing is getting displayed, nor any errors
param=50
value=19.23
for(i=0;i<4;i++)
{... (2 Replies)
Discussion started by: jisha
2 Replies
9. UNIX for Advanced & Expert Users
Dear All
How are you
I have files which look like this :
20080406_12:43:55.779 ISC Sprint- 39 21624032999 218925866728
20080406_12:44:07.811 ISC Sprint- 20 21620241815 218927736810
20080406_12:44:00.485 ISC Sprint- 50 21621910404 218913568053... (0 Replies)
Discussion started by: zanetti321
0 Replies
10. Shell Programming and Scripting
Hallo all,
I have a script which creates an output ... see below:
root@a7germ:/tmp/pax > cat 20061117.txt
523.047
521.273
521.034
517.367
516.553
517.793
513.114
513.940
I would like to use awk to calculate the (a)total sum of the numbers (b) The average of the numbers.
Please... (4 Replies)
Discussion started by: kekanap
4 Replies