12-19-2003
10 More Discussions You Might Find Interesting
1. 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
2. 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
3. UNIX for Dummies Questions & Answers
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)
Discussion started by: risshanth
0 Replies
4. UNIX for Dummies Questions & Answers
Hi there, I'm trying to add to a number leading zeros if it's just one digit. My code looks like this:
d=`date +%d`
if ; then
d=$((d-1)) # yesterday
if (length($d) -eq 1); then
d=0$d
# this doesn't work if it's the 1st of the month :-(
fi
...
$d... (4 Replies)
Discussion started by: borobudur
4 Replies
5. Shell Programming and Scripting
Hi,
I am having problem in deleting the leading spaces:-
cat x.csv
baseball,NULL,8798765,Most played
baseball,NULL,8928192,Most played
baseball,NULL,5678945,Most played
cricket,NOTNULL,125782,Usually played
cricket,NOTNULL,678921,Usually played
$ nawk 'BEGIN{FS=","}!a... (2 Replies)
Discussion started by: scripter12
2 Replies
6. Shell Programming and Scripting
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)
Discussion started by: samoptimus
5 Replies
7. Shell Programming and Scripting
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)
Discussion started by: udelalv
2 Replies
8. Shell Programming and Scripting
I have the following script that renames filenames like:
blah_bleh_91_2011-09-26_00.05.43AM.xls
and transforms it in:
91_20110926_000543_3_blih.xls
for a in *.xls;
do
b="$(echo "${a}" | cut -d '_' -f4)"
dia=`echo ${b} | cut -c9-10`
mes=`echo ${b} | cut -c6-7`
anio=`echo ${b} | cut -c1-4`... (4 Replies)
Discussion started by: Tr0cken
4 Replies
9. 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
10. Shell Programming and Scripting
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