Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to control the decimal points for p-values in scientific format? Post 302920634 by forevertl on Friday 10th of October 2014 02:41:17 PM
Old 10-10-2014
It works well. Thank you!

Quote:
Originally Posted by Corona688
Code:
awk '$1 = $1 + 0' CONVFMT="%.3g" infile > outfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sorting with header and mixed numerals (scientific and decimal) | awk

Assoc.txt CHR SNP BP A1 TEST NMISS OR STAT P 1 rs2980319 766985 A ADD 4154 1.024 0.1623 0.8711 1 rs2980319 766985 A AGECAT 4154 1.371 6.806 1.003e-11 1 ... (6 Replies)
Discussion started by: genehunter
6 Replies

2. UNIX for Dummies Questions & Answers

awk for scientific notion and decimal combined data

Dea all, I have a question. I have a column of numbers with scientific notion and decimal combined data. I want to print it only if the number <0.05 using awk. however the very small numbers with scientific notion is not selected. Do any one know how to solve it? Thanks! example as below: ... (4 Replies)
Discussion started by: forevertl
4 Replies

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

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. Homework & Coursework Questions

Grep commands for numbers w/decimal points

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Is there a grep commands for numbers w/decimal points Display lines for students with GPA above 3.69 but less... (3 Replies)
Discussion started by: jetoutant
3 Replies
MAKE_SOCKSFC(8) 					      System Manager's Manual						   MAKE_SOCKSFC(8)

NAME
make_socksfc - Generates frozen configuratyion file for SOCKS clients SYNOPSIS
make_socksfc [infile [outfile] ] DESCRIPTION
make_socksfc reads in a plain-text configuration file for the SOCKS clients and produces a frozen configuration file as the output. Both arguments are optional. The default for infile is /etc/socks.conf; the default for outfile is /etc/socks.fc. You may specify infile while omitting outfile, but you cannot specify outfile without also speficying infile. The contents of the frozen configuration file is essentially the memory image of the parsed input file. Using the frozen configuration file can reduce the start-up delay of the SOCKS client programs since they no longer have to parse the file contents. When the SOCKS client starts, it always looks for the frozen configuration file /etc/socks.fc first . If that file is not found, it then tries to use the plain-text configuration file /etc/socks.conf. If you use frozen configuration, you must remember to run make_socksfc every time after you modify the plain-text file or the SOCKS clients will continue to use the frozen file of a previous configuration. To find out the contents of a frozen configuration file, use dump_socksfc. FILES
/etc/socks.fc, /etc/socks.conf SEE ALSO
dump_socksfc(8), socks.conf(5), socks.fc(5) AUTHOR
Ying-Da Lee, yingda@esd.sgi.com or yingda@best.com May 6, 1996 MAKE_SOCKSFC(8)
All times are GMT -4. The time now is 02:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy