Help with Round Up with 2 decimal point at specific column
Input file:
Desired output file:
Command try:
I able to get what I want, but the way I did.
It seems like not so "nice"
Thus just wonder whether how to specific just do 2 decimal point at specific column.
Hi,
I have input with decimal point ( 9.99 ) for hours variable hrs.
I need to change it to seconds.
Here is my code:
secs=`/usr/ucb/echo $hrs*3600 |bc`
But I don't want to see the decimal point.
I can use awk to trim it if there is one.
I am just wondering if there is better standard... (2 Replies)
Hi all. Using /bin/sh on an HPUX system.
I want to place a decimal in the field 2 charactors from the right (yes, converting to currency). The field lengths are variable. Here's what I'm doing:
exec < filename
while read FIELD1 FIELD2
do
FIELD1="echo $FIELD1 | sed 'syntax that will... (4 Replies)
Hi
In Unix, I have a file with some numbers like :
45600
12345
I want to insert a decimal point for these numbers based on user input.
If the input is 2, the numbers should be changed to
456.00
123.45
If the input is 3, the numbers should be changed to
45.600
12.345
Can... (2 Replies)
i have a file in which 3 values are stored like --4.72 4.42 3.86
what i wanna do is that take read each value and compare with a fixed value say 5 but cant do so as i am getting an error for the same.
please check the code
cat /home/nsadm/auto/Logging/uptime.txt| while read a b c
do
if... (2 Replies)
Please help me in rounding up value upto 2 decimal palces using sed command
#!/usr/bin/bash
a=15.42
b=13.33
c=`echo $a*$b |bc -l`
echo $c
above code is is giving output "205.5486" but i want the output as "205.55"
Thank you... (15 Replies)
Hi,
I have an issue converting decimal places of a particular column, i am using below script to get the output, but the output is not generating in desired format.
awk -F"," 'BEGIN{OFS=","}{if(NR==0)getline;if ($7 != "") {if ($7 > 0) $7=$7/100 ; {printf "%.2f"... (3 Replies)
Hi All,
Please help for the following scenario where I want to add a delimiter after 2 decimal point integer.
Original Line
1007937820§L§2016-12-19§000000002§2018-02-01§2050-12-01§00395§M§146713.57§00005.05000§762.59§00395§M§301223.0528§1165§2017-03-31 20:34:25
Expected Line... (12 Replies)
Hi,
I want to round of decimal numbers in comma seperated lines till 2 decimal numbers.
line will be like.
... (4 Replies)
Discussion started by: vishal0746
4 Replies
LEARN ABOUT OSX
test::output::tie
Test::Output::Tie(3) User Contributed Perl Documentation Test::Output::Tie(3)NAME
Test::Output::Tie - module used by Test::Output to tie STDERR and STDOUT
DESCRIPTION
You are probably more interested in reading Test::Output.
This module is used to tie STDOUT and STDERR in Test::Output.
Methods
TIEHANDLE
The constructor for the class.
PRINT
This method is called each time STDERR or STDOUT are printed to.
PRINTF
This method is called each time STDERR or STDOUT are printed to with "printf".
FILENO
BINMODE
read
This function is used to return all output printed to STDOUT or STDERR.
AUTHOR
Currently maintained by brian d foy, "bdfoy@cpan.org".
Shawn Sorichetti, "<ssoriche@cpan.org>"
SOURCE AVAILABILITY
This module is in Github:
http://github.com/briandfoy/test-output/tree/master
COPYRIGHT & LICENSE
Currently maintained by brian d foy, "bdfoy@cpan.org".
Copyright 2005-2008 Shawn Sorichetti, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
ACKNOWLEDGMENTS
This code was taken from Test::Simple's TieOut.pm maintained Michael G Schwern. TieOut.pm was originally written by chromatic.
Thanks for the idea and use of the code.
perl v5.16.2 2011-04-21 Test::Output::Tie(3)