10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi ALL,
I am having semi column separated file as below. I am having negative values for the records starting with 11095. How can I convert that positive number
I tried this below seems not working
sed 's/ \(*\)$/ -\1/;t;s/\(.*\)-/\1/ myfile
myfile... (6 Replies)
Discussion started by: arunkumar_mca
6 Replies
2. Shell Programming and Scripting
I have a below snippet of code from my perl script and its causing a problem when the output of $lTAX is 0 (zero) its getting displayed as -0.00. I want output to be 0 not -0.00. Any help would be appreciated.
#!/usr/bin/perl
my $lTotA = 50.94;
my $lVatA = 8.49;
my $lAllocD;
my $lAdjNr =... (4 Replies)
Discussion started by: Devesh5683
4 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am having a problem in converting a string to number so I can preform arithmetic operations.
timeTot=0
timeTmp=$(cat idsOutput | grep 'Run time' | cut -c 36-39)
timeTot=$ #This is line 28
echo "total RunTime=" $timeTot
this is the error msg:
./ids2.sh: line 28: 0+1.35: syntax... (8 Replies)
Discussion started by: turki_00
8 Replies
4. Shell Programming and Scripting
Hi Gurus,
I am working with a korn shell script to simplify some operations of calculation number of lines inside compressed file.
The called function (inside a cycle) is the following:
#########################################
# F.ne: CheckCount
#########################################... (3 Replies)
Discussion started by: GERMANICO
3 Replies
5. Shell Programming and Scripting
Hi,
I have a file with occurances of the string "TO_DATE(<number here>,'J')" at random places. I need minus 2400000 from the number and replace the string with "convert(date, dateadd(dd, <new number here>,'16 Nov 1858')".
I'm finding this difficult as the string isn't necessarily in the... (9 Replies)
Discussion started by: user_invalid
9 Replies
6. Shell Programming and Scripting
Dear users,
I need your support, I have a file like this:
272134.548 6680572.715
272134.545 6680572.711
272134.546 6680572.713
272134.548 6680572.706
272134.545 6680572.721
272134.543 6680572.710
272134.544 6680572.715
272134.543 6680572.705
272134.540 6680572.720
272134.544... (10 Replies)
Discussion started by: Gery
10 Replies
7. Shell Programming and Scripting
Hi All,
I am writing a shell script in which I want to convert a number like :
Suppose the number is "98487657" and we have to convert it to "98000000", what I want to do is to retain first 2 digits and convert all remaining digits to "0".
Number could be of any length (length... (4 Replies)
Discussion started by: amitanshu.verma
4 Replies
8. Shell Programming and Scripting
Hi,
I have the following file input:-
542 4795 61
543 4795 61
544 0 0
545 292 ... (5 Replies)
Discussion started by: ahjiefreak
5 Replies
9. Shell Programming and Scripting
I have written a script to compare the values of string (which actually are numbers) but it is not giving the expected output. Please suggest for the script.
#!/usr/bin/ksh
sysdate=20071009
echo $sysdate
currfile=20071008
echo $currfile
if ; then
echo "Equal"
else
echo "Not... (2 Replies)
Discussion started by: raman1605
2 Replies
10. Programming
HI
Hi I have a character string which contains some special characters and I need it to display as a hex string.
For example, the sample i/p string: ×¥ïA Å gïÛý and
the o/p should be : D7A5EF4100C5010067EFDBFD
Any pointers or sample code pls. (5 Replies)
Discussion started by: axes
5 Replies