10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi , I have a file which contains text like
A|Mau|Code|12|Detail
B|Mau|Code|20|Header
I want to write a command using awk which will output
A|Mau|Code|12.00|Detail
B|Mau|Code|20.00|Header
I used a command like awk -F"|" {printf "%s|%s|%s|%.2f|%s",$1,$2,$3,$4,$5}' which does the... (4 Replies)
Discussion started by: LoneRanger
4 Replies
2. UNIX for Beginners Questions & Answers
hi there I being trying to figure out way to add " .0" to an integer value in a csv using sed or awk with out success. just as a work around for 2147483647 32 bit limitation that influxdb is currently having
the data base will accept values and work fine if it has the XXX.0 ... (7 Replies)
Discussion started by: sash99
7 Replies
3. UNIX for Beginners Questions & Answers
Hi!
I found and then adapt the code for my pipeline...
awk -F"," -vOFS="," '{printf "%0.2f %0.f\n",$2,$4}' xxx > yyy
I add -F"," -vOFS="," (for input and output as csv file) and I change the columns and the number of decimal...
It works but I have also some problems... here my columns
... (7 Replies)
Discussion started by: echo manolis
7 Replies
4. Shell Programming and Scripting
Hi,
i need to move the decimal point from a file listing some numbers like this :
49899.50
49914.55
49894.48
49939.65
49879.44
49919.57
49934.62
49944.67
49954.72 (1 Reply)
Discussion started by: Board27
1 Replies
5. Shell Programming and Scripting
Input file:
USA 20.5683
UK 3.54221
Japan 2.54001
China 2.50897
Germany 2.05816
.
.
Desired output file:
USA 20.57
UK 3.54
Japan 2.54
China 2.51
Germany 2.06
.
. (2 Replies)
Discussion started by: perl_beginner
2 Replies
6. Shell Programming and Scripting
Hi All,
Can some one help me in identifying the significance of character "$" ,Which is playing critical role in matching decimal point numbers as below.
$ echo "01#.01"|awk '{if ($0 ~ /^+(\.*)?$/) print}'
$ echo "01#.01"|awk '{if ($0 ~ /^+(\.*)?/) print}'
01#.01
$
Regards,
Rmkganesh. (3 Replies)
Discussion started by: rmkganesh
3 Replies
7. Shell Programming and Scripting
Hi everyone,
I am new here and generally not experienced with linux. My question must be easy, but as for now I have no idea how to do it.
I have lots of directories with numerical names, e.g. 50 50.1 50.12 etc. What I want is to leave directories with no or single digit after the decimal... (2 Replies)
Discussion started by: cabaciucia
2 Replies
8. Shell Programming and Scripting
How to compare two numbers with decimal points ?
Is there a way in bash to do this? (33 Replies)
Discussion started by: kinny
33 Replies
9. Shell Programming and Scripting
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)
Discussion started by: lyoncc
4 Replies
10. Shell Programming and Scripting
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)
Discussion started by: cin2000
2 Replies