10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Is there a fast way to convert a negative decimal value into a signed binary number in bash script ? I've looked a lot on internet but I saw nothing... (For exemple : -1 become 11111111.) (9 Replies)
Discussion started by: Zedki
9 Replies
2. Shell Programming and Scripting
Hi Gurus,
I have requirement need to sum the value, the logic is if the value is negative then time -1, I tried below two ways. one is failed, another one doesn't work.
awk -F"," '{if($8< 0 $8*-1 else $8) sum+=$8}{print sum, $8} END{printf("%.2f\n",sum)}'
awk -F","... (4 Replies)
Discussion started by: ken6503
4 Replies
3. Shell Programming and Scripting
Can anyone please assist me?
Please find the attached input and output file for ur reference.
a)Incase if i get negative value (ex:-000100) in the 11th column then i have to convert the value to 0000000(7 zeros-length is 7) and then
print the entire record.
b)Incase if there is no... (2 Replies)
Discussion started by: vinus
2 Replies
4. Shell Programming and Scripting
Hi All,
i have 20 Obligors when ever i dont find all of them on particular row/line from each in put i need to print it in different file.
using below command but it is not working please help at earliest.
Steps:
set -A FILENAME $( cat... (10 Replies)
Discussion started by: rajubollas
10 Replies
5. Shell Programming and Scripting
Hi, I am trying to multiply column#1 with column#2 using a shell script. How can I make a for-loop script using 1st column as "i" and the second column as "j" from the following file? Please feel free to share any alternative ways to multiplying column#1 with column#2.
.06 5.0000
.49 ... (6 Replies)
Discussion started by: momin
6 Replies
6. Shell Programming and Scripting
Hi, i need help on replacing negative values in a column with 0. any quick fix on this? thanks much. for instance,
input:
1
2.3
-0.4
-25
12
13
45
-12
desired output
1
2.3
0
0
12
13
45 (4 Replies)
Discussion started by: ida1215
4 Replies
7. Shell Programming and Scripting
I need code for converting a string to a negative decimal value.
For ex, i have the value in the form of a string (5489.95-) i need to convert it into decimal value (-5489.95) while getting output using printf command.
i know how to get as a string
a="5489.95-"
printf "%10s"$a >>xyz.dat
... (5 Replies)
Discussion started by: angie1234
5 Replies
8. Shell Programming and Scripting
Im very new to programming. But I would like to write a script which extracts and multiply values from 2 txt and output as a new file. Can someone please teach me how to write it? Thank you so much
for example
File A File B
1 34 1 2
2 13 2 2
3 8 3 3
File C output
1 68
2... (2 Replies)
Discussion started by: crunchichichi
2 Replies
9. Shell Programming and Scripting
Hello,
I have a list like this :
1
2
-4
0
-3
-7
5
6 etc.
Is there a way to remove all the positive values and print only the negative values, without using grep, sed or awk?
Thanks,
Prasanna (4 Replies)
Discussion started by: prasanna1157
4 Replies
10. 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