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
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
4. Shell Programming and Scripting
Hi There,
I am trying to load data from a csv file into a DB during our DB migration phase. I am successfully able export all data into a .csv file but those have to rewritten in terms insert statement which will allow for further population of same data in different DB
My exiting csv record... (6 Replies)
Discussion started by: bhaskar_m
6 Replies
5. UNIX for Advanced & Expert Users
I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation?
Here is my query:
cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}'
02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies
6. 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
7. 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
8. Shell Programming and Scripting
Hi,
I have a task where i need to compare columns of two files.
First file is $REG_InputFileName:
"UPDATE","1010021126","1-01-01","USD"
"UPDATE","1013000101","1-01-01","THB"
"UPDATE","1013010107","1-01-01","THB"
"UPDATE","1110011122","1-01-01","USD"... (5 Replies)
Discussion started by: manmeet
5 Replies
9. Shell Programming and Scripting
I have a list of coordinate data, sampled below.
54555209 784672723
I want it as:
545552.09 7846727.23
Below is my script:
BEGIN {FS= " "; OFS= ","} {print $1*.01,$2*.01}
This is my outcome:
5.5e7 7.8e8
How do I tell awk that I want to keep all the digits instead of outputting... (1 Reply)
Discussion started by: ndnkyd
1 Replies
10. 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