Sponsored Content
Full Discussion: cut
Top Forums Shell Programming and Scripting cut Post 302132491 by goshort on Friday 17th of August 2007 06:52:08 AM
Old 08-17-2007
cut

Hi,

I need to manipualte the data in the file below so that the value fields on each line are truncated to just two decimal places. Meaning i want to delet everything after two decimal places on each record in the file.

I have highlighted the first value field.

02331814579359.6500000004
0348991976138.6767000001
04201280145145.4400000002
08654312609500.3800000002
09155934830963.3300000018
10166784506.0399999991
11884517456.5800000032
12108694361.4000000014
1324377035481.8500000004
15962912770.06
170101083.84826

I can obviously use SED to find the decimal point, but can someone please advise on how to use cut in order to truncate the values after the decimal point as required ?

Thanks
Rgds

Paul
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies

2. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

3. Shell Programming and Scripting

Using :<<cut / cut to comment out block of bash script

I am using : << cut / cut to comment out block of code. Works fine on few lines of script, then it gives me this cryptic error when I try to comment out about 80 lines. The "warning " is at last line of script. done < results 169 echo "END read all positioning parameters" 170... (8 Replies)
Discussion started by: annacreek
8 Replies
_encodedecimal64(3M)													      _encodedecimal64(3M)

NAME
_encodedecimal64(), _encodedecimal128(), _encodedecimal32() - encode decimal-encoded decimal data SYNOPSIS
DESCRIPTION
There are two standard bit-encodings for decimal floating-point data: binary and decimal. Both encoding provide exactly the same data (analogous to big endian and little endian encodings). The HP-UX decimal floating-point types use the binary encoding. The function encodes x as a decimal-encoded 64-bit decimal datum. is a version of it takes a argument and returns a result. is a version of it takes a argument and returns a result. These math functions are supported for HP-UX 11i Version 3 September 2008 Update and forward. USAGE
To use any of these functions, compile with the option. Make sure your program defines and then includes Link in the math library by specifying or on the linking command line. For more information, see the at the following site: RETURN VALUE
returns x in the decimal encoding. raises no exceptions. ERRORS
No errors are defined. SEE ALSO
_decodebinary64(3M), _decodedecimal64(3M), _encodebinary64(3M), math(5). STANDARDS CONFORMANCE
These functions are not specified in any standard. HP Integrity Server Only _encodedecimal64(3M)
All times are GMT -4. The time now is 07:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy