Sponsored Content
Homework and Emergencies Homework & Coursework Questions Grep commands for numbers w/decimal points Post 303007956 by MadeInGermany on Friday 24th of November 2017 03:52:50 AM
Old 11-24-2017
Quote:
[3.69-4.00]
does not work. A character set [ ] is a range for only one character!
As said in your other thread, you must have a character set for each relevant character position.
A 3 then a dot then a character set for the range 7-9. This does not match a 4.00 and is correct because it should be less than 4.0.
If there are always two decimal digits then you can add a further character set [0-9] that means "any digit".
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regarding decimal numbers

Hello... I am new to unix and I am wondering if in a C-shell script , Are we supposed to use only whole numbers........ for example..if a program needs to calculate the average of some numbers........ @ avg = (($1 +$2 + $3)/3)) is returning a whole number.........How can a decimal be... (7 Replies)
Discussion started by: ravindra22
7 Replies

2. Shell Programming and Scripting

how to get rid of all chars after the last decimal points

Hi All, Here is my original string: 192.168.2.1.8088. The target string I want: 192.168.2.1, how can I use awk or sed or other command to get rid of .8088 in the string? Thanks, Ray (9 Replies)
Discussion started by: rluo
9 Replies

3. UNIX for Dummies Questions & Answers

accuracy of output - decimal points

Is there a way when using awk to specify the number of decimal points needed for the output? (2 Replies)
Discussion started by: cosmologist
2 Replies

4. Shell Programming and Scripting

How to sort when there is variable length decimal points.?

Hi Experts, Quick quesion: I want to sort this in the file , but not working, when using # sort file name 305.932 456.470 456.469 456.468 456.467 172.089 456.467 456.466 456.465 111.573 111.578 111.572 111.572 87.175 87.174 75.898 (4 Replies)
Discussion started by: rveri
4 Replies

5. Shell Programming and Scripting

Reducing the decimal points of numbers (3d coordinates) in a file; how to input data to e.g. Python

I have a file full of coordinates of the form: 37.68899917602539 58.07500076293945 57.79100036621094 The numbers don't always have the same number of decimal points. I need to reduce the decimal points of all the numbers (there are 128 rows of 3 numbers) to 2. I have tried to do this... (2 Replies)
Discussion started by: crunchgargoyle
2 Replies

6. Shell Programming and Scripting

Shell arithmetic : operations on decimal points

i am having a varialbe a , which is input to my file i want to multiply this input with value .43, and assign it to variable b. i tried it as below: #!/bin/sh a=$1 b=`expr $1\*0.43` echo b=$b error : expr: non-integer argument Please tell me , how to do this. Thanks (10 Replies)
Discussion started by: rishifrnds
10 Replies

7. UNIX for Dummies Questions & Answers

Help with decimal points

Hi All, I would like to set decimal point to 16 in the following bash script but it has syntax error at }: awk '{printf"%.16e", (a<500,a++,$1/(a*1.1212121212121229e-02))}' input.dat >output.datHow may I set it in the correct way please? Thank you very much! (6 Replies)
Discussion started by: sxiong
6 Replies

8. UNIX for Dummies Questions & Answers

How to control the decimal points for p-values in scientific format?

Dear all, I have a txt file with only one column which contains p values. My data looks like this: 5.04726976606584e-190 2.94065711152402e-189 2.94065711152402e-189 9.19932135717279e-176 1.09472516659859e-170 1.24974648916809e-170 0.1223974648916 0.9874974648916 ... what I want... (2 Replies)
Discussion started by: forevertl
2 Replies

9. Shell Programming and Scripting

Using awk to place decimal points at proper position

Hi, I have one input file which is delimited by pipe. I want to put decimal points in this input file at particular position in particular column and also get the negative sign (if any) at start of that column. $ cat Input_file.txt 11|10102693|1|20151202|10263204|20151127|N|0001... (7 Replies)
Discussion started by: Prathmesh
7 Replies

10. UNIX for Beginners Questions & Answers

Decimal numbers and letters in the same collums: round numbers

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
ISWDIGIT(3)						     Linux Programmer's Manual						       ISWDIGIT(3)

NAME
iswdigit - test for decimal digit wide character SYNOPSIS
#include <wctype.h> int iswdigit(wint_t wc); DESCRIPTION
The iswdigit() function is the wide-character equivalent of the isdigit(3) function. It tests whether wc is a wide character belonging to the wide-character class "digit". The wide-character class "digit" is a subclass of the wide-character class "xdigit", and therefore also a subclass of the wide-character class "alnum", of the wide-character class "graph" and of the wide-character class "print". Being a subclass of the wide character class "print", the wide-character class "digit" is disjoint from the wide-character class "cntrl". Being a subclass of the wide-character class "graph", the wide-character class "digit" is disjoint from the wide-character class "space" and its subclass "blank". Being a subclass of the wide-character class "alnum", the wide-character class "digit" is disjoint from the wide-character class "punct". The wide-character class "digit" is disjoint from the wide-character class "alpha" and therefore also disjoint from its subclasses "lower", "upper". The wide-character class "digit" always contains exactly the digits '0' to '9'. RETURN VALUE
The iswdigit() function returns nonzero if wc is a wide character belonging to the wide-character class "digit". Otherwise, it returns zero. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +-----------+---------------+----------------+ |Interface | Attribute | Value | +-----------+---------------+----------------+ |iswdigit() | Thread safety | MT-Safe locale | +-----------+---------------+----------------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C99. NOTES
The behavior of iswdigit() depends on the LC_CTYPE category of the current locale. SEE ALSO
isdigit(3), iswctype(3) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU
2015-08-08 ISWDIGIT(3)
All times are GMT -4. The time now is 03:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy