10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a variable LOGNUM with values 0000095, When i subtract the variable by 1, Its losing its leading zeros. Can you please help me here ?
LOGNUM=0000095
$OLDLOG=`echo "${LOGNUM}-1"|bc`
$ echo $OLDLOG
94
Am expecting output as
0000094
Appreciate your help!
Thanks,... (11 Replies)
Discussion started by: prince1987
11 Replies
2. 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
3. Shell Programming and Scripting
Hi I have a simple request but can't find the answer. I want to remove trailing zeros, and in some cases the fullstops, from the input data. Example of input file:
FR002_15.000_20.000
SD475_5.000_10.500
FG5647_12.250_15.500
BH2463_30.555_32.000
Desired output file would be:
... (10 Replies)
Discussion started by: theflamingmoe
10 Replies
4. Shell Programming and Scripting
Hi All,
I have 100 files with names like this:
1.dat, 2.dat, 3.dat until 100.dat.
My dat files look like this:
42323 0
438939 1
434 0
0.9383
3434
120.23 3
234
As you can see in the second column, some numbers are missing. I want to fill those missing places with 0's in all... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
5. Shell Programming and Scripting
hi
i want to append zeros to a given number ( varying digits). the total length of the output should be 10 digits. For example:
1)input is var=347
output should be NewVar=0000000347
2) input is var=123456
output should be NewVar=0000123456
i am able to acheive this using typeset... (1 Reply)
Discussion started by: somi2yoga
1 Replies
6. Shell Programming and Scripting
Hello All,
I have a csv file with 3 columns. The file which looks like this
47850000,100,233
23560000,10000,456
78650000,560000,54
34000000,3456,3
The first column has 4 trailing zeros. I have to remove 4 trailing zeroes from 1st field. The output file should appear as follows.
... (12 Replies)
Discussion started by: grajp002
12 Replies
7. Shell Programming and Scripting
Hi All
I want to delete trailing zeros from varible.
ex:
if variable value is 1234.567000 result as 1234.567
if variable has 1234.0000 result as 1234
if variable as abcd.fgh result as abcd.fgh
Can somone give me a solution using awk? (16 Replies)
Discussion started by: Chandu2u
16 Replies
8. Shell Programming and Scripting
Hello, I am trying to write a script that will calculate the amount of data remaining in a storage volume. I'm running Tru64 Unix version 5.1B patch kit 6. The script is being run against an AdvFS domain. I am programming in Korn Shell version M-11/16/88f.
The basic idea is that I want to run df... (3 Replies)
Discussion started by: Heathe_Kyle
3 Replies
9. Shell Programming and Scripting
Hi all,
Can anybody help me out to write a program in perl to remove O and preceeding zeros.
for eg input is O0000123089 - output 123089
Thanks
Mahalakshmi.A (10 Replies)
Discussion started by: mahalakshmi
10 Replies
10. Shell Programming and Scripting
Hello all, I have a list of reports for stores that are numbered like:
s001845,s000022,s198490,s020048,s002385
however the users are displaying the reports as:
1845,22,198490,20048,2385
It isn't real critical but I would like to associate them so they are the same. And since the users are... (2 Replies)
Discussion started by: gozer13
2 Replies