10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
i have a variable which conatins values like 00001,0003,00067,00459.
I want to use the values one by one and in the same form as they are like 00001,0003,00067,00459.
Also can anyone tell me how to increment those numbers by 1,keeping the format as same like 00002,0004,00068,00460.... (5 Replies)
Discussion started by: arijitsaha
5 Replies
2. Shell Programming and Scripting
Hi all,
I'm struggling :wall: to make a an if statement on two variables in scientific format.
e.g.
a=1.23e+01
b=3.21e+02
I know that it can be done with bc if the variable are not in scientific format.
But what to do in this case???
Thank you, (3 Replies)
Discussion started by: f_o_555
3 Replies
3. UNIX for Dummies Questions & Answers
Hello Gurus,
Quick question. I have a file with the following records:
A~000000000000518000~SLP ~99991231~20090701~88.50~USD~CS~
A~000000000000518000~SLP ~99991231~20090701~102.00~USD~CS~
A~000000000000772000~SLP ~99991231~20100701~118.08~USD~CS~
I wold like to do the following:
1. Add... (1 Reply)
Discussion started by: chumsky
1 Replies
4. UNIX for Dummies Questions & Answers
How do I use bash to add all the floating point numbers saved in a file like this?
490.47
244.61
263.07
131.59
246.81
115.20 (3 Replies)
Discussion started by: locoroco
3 Replies
5. Shell Programming and Scripting
Hi !
I'm looking for a way to transform certain floating point numbers in a one-line, variable length file to integers.
I can do this in a crude way with sed :
sed -e 's/0\.\(\):/\1:/g' -e 's/0\.0\(\):/\1:/g' -e 's/1\.000:/100:/g' myfile ... but this doesn't handle the rounding correctly.
... (3 Replies)
Discussion started by: jossojjos
3 Replies
6. Shell Programming and Scripting
How do I remove or add leading zeroa from a variable. To make variable 10 characters long when adding zeros. (6 Replies)
Discussion started by: toshidas2000
6 Replies
7. Shell Programming and Scripting
I have a two files
>cat file1
jjjjj 10.345 6.673
ppp 9.000 5.883
>cat file2
mmm 80 10
jjjjj 10.305 6.873
ppp 9.000 5.883
I am reading file 1 line by line , and look for the string jjjj and then read the line in file 2 with jjjj
I want to get the... (5 Replies)
Discussion started by: jojan
5 Replies
8. Shell Programming and Scripting
Hi All,
I am working with a fixed width file Forrmat.
C1 Number (10,3)
C2 Number (10,3)
e.g.
c1= 0000000100.000
c2= 0000000020.000
0000000100.0000000000020.000
I have to perform c1 - c2 . i.e. I want answer to be 0000000080.000. but I am loosing the leading zeros( only getting... (3 Replies)
Discussion started by: Manish Jha
3 Replies
9. Shell Programming and Scripting
How to insert leading zeros into a left-justisfied zip code?
e.g. Zip code is written as 60320 which is left-justified to make it be read as 0060320.
We have to move it to right-justifiable then insert 2 leading zeros into it... ;) (1 Reply)
Discussion started by: wtofu
1 Replies
10. Shell Programming and Scripting
HI all,
Can someone help me how to use or assign a floating point value in a variable in a unix script. I dont know how to use it.
for example, I am to assign a variable VAR1 a value of 2.34 and evaluate if a certain vaue is greater or less than to it.
That is,
if var1 > 2.13 will do... (7 Replies)
Discussion started by: darry
7 Replies