I'm trying to write a script that compare's some numeric values in a file, but in one of the files the value always has leading zero's. For example -
temp_8719_LM344_20031216091826: printera : 552 : 276 : 552 : 276
temp_8719_LM344_20031216091826: printera : 000552 :000276 : 000552 : 000276
... (5 Replies)
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)
Hi,
I do have a code as follows:
function deHex {
if ]; then
deHexDate=${1:1:$2}
fi
}
The description given for the above code is as follows:
# description: removes leading zero so value will not be recognized as hex
# usage: deHex <value_parameter> <value_input_length>
... (0 Replies)
Hello, I am (trying) to write a script that will check to see how many users are logged on to my machine, and if that number is more than 60 I need to kill off all the oldest sessions that are over 60. So far I have been able to check how many users are on and now I am at the part where I have to... (3 Replies)
Hi,
Can anyone help me how to add leading zero's (0's) infront of numbers in unix script.
For more details.
x=450
Y=2344
i want the out put of 00000450, 000002344 (leading 5 zeros)
Thanks
A. Raj. (8 Replies)
I need to add leading zeros in a floating point numbers.
The length of the number should be 13 including decimal.
The input number is changing so number of leading zeros is not fix.
For example
input output
216.000 000000216.000
1345.000 000001345.000
22345.500 ... (4 Replies)
hi All
i am new to linux...
source txt ..
281-BUM-5M BUM-5M 0 0
282-BUM-5M BUM-5M 0 0
83-BUM-5M BUM-5M 0 0
is it possible to use bash script to convert to
(remove the "-" and fill up to 4 digit" ?
0281 BUM-5M BUM-5M 0 0
0282 BUM-5M BUM-5M 0 0
0083 BUM-5M BUM-5M 0 0
thanks a ... (5 Replies)
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)
Hello.
I'm trying to add multiple numbers with varying length and with leading zeroes in it. However, I'm getting the sum (totalHashAccountNumber) without the leading zeroes in it. How do I retain the leading zeroes?
Please pardon the lengthy code.. I'm getting the hash account number from 2... (2 Replies)
Hi
Ich have a list as follows
73
5
100
45
81
4
and I would like to have an output (on screen) like that
73
5
100
45
81
4 (6 Replies)
Discussion started by: lazybaer
6 Replies
LEARN ABOUT HPUX
strtoimax
strtoimax(3C)strtoimax(3C)NAME
strtoimax(), strtoumax() - convert string to integer
SYNOPSIS DESCRIPTION
or converts the character string pointed to by str to or representation, respectively. The string is scanned up to the first character
inconsistent with the base. Leading ``white-space'' characters (as defined by in ctype(3C)) are ignored. If no conversion can take place,
zero is returned.
If base is greater than or equal to 2 and less than or equal to 36, it is used as the base for conversion. After an optional leading sign,
leading zeros are ignored, and or is ignored if base is 16.
If base is zero, the string itself determines the base as follows: after an optional leading sign, a leading zero indicates octal conver-
sion; a leading or indicates hexadecimal conversion. Otherwise, decimal conversion is used.
If the value of ptr is not a pointer to the character terminating the scan is returned in the location pointed to by ptr. If no integer
can be formed, the location pointed to by ptr is set to str, and zero is returned.
RETURN VALUE
Upon successful completion, all functions return the converted value, if any.
If the correct value would cause overflow:
returns or (according to the sign of the value), and sets to
returns and sets to
For all other errors, zero is returned and is set to indicate the error.
ERRORS
and fail and is set, if any of the following conditions are encountered:
The value of base is not supported.
The value to be returned would have caused overflow.
AUTHOR
and were developed by HP.
SEE ALSO ctype(3C), strtod(3C), strtol(3C), scanf(3S), thread_safety(5).
STANDARDS CONFORMANCE strtoimax(3C)