Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to control the decimal poins for the whole .txt file? Post 302920659 by forevertl on Friday 10th of October 2014 04:38:56 PM
Old 10-10-2014
one issue

Hi,
Thanks a lot for the reply. I forgot to mention that there is some "NA" in the file, now using the code, it works well except for those NAs. The NA changed to 0.000 now. Is there a way that keep NA as NA? Thanks a lot!
Lin

Quote:
Originally Posted by RavinderSingh13
Hello forevertl,

Could you please try following.

Code:
awk '{for(i=1;i<=NF;i++){if(i==NF){printf "%.3f\n",$i} else {printf "%.3f ",$i}}}'  Input_file

Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Binary txt file received when i use uuencode to send txt file as attachment

Hi, I have already read a lot of posts on sending attachments in unix...but none of them were of help for my problem...so here goes.. i wanna attach a text file and send to a mail id..used the following code : uuencode "$File1" "$File1" ;|mail -s "$Mail_sub" abc@abc.com it works... (2 Replies)
Discussion started by: ash22
2 Replies

2. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies

3. Shell Programming and Scripting

command to list .txt and .TXT file

Hi expersts, in my directory i have *.txt and *.TXT and *.TXT.log, *.txt.log I want list only .txt and .TXT files in one command... how to ?? //purple (1 Reply)
Discussion started by: thepurple
1 Replies

4. Shell Programming and Scripting

PERL:How to convert numeric values txt file to PACKED DECIMAL File?

Is there any way to convert numeric values txt file to PACKED DECIMAL File using PERL. Regards, Alok (1 Reply)
Discussion started by: aloktiwary
1 Replies

5. Shell Programming and Scripting

awk append fileA.txt to growing file B.txt

This is appending a column. My question is fairly simple. I have a program generating data in a form like so: 1 20 2 22 3 23 4 12 5 43 For ever iteration I'm generating this data. I have the basic idea with cut -f 2 fileA.txt | paste -d >> FileB.txt ???? I want FileB.txt to grow, and... (4 Replies)
Discussion started by: theawknewbie
4 Replies

6. Shell Programming and Scripting

Need to append the date | abcddate.txt to the first line of my txt file

I want to add/append the info in the following format to my.txt file. 20130702|abcd20130702.txt FN|SN|DOB I tried the below script but it throws me some exceptions. <#!/bin/sh dt = date '+%y%m%d'members; echo $dt+|+members+$dt; /usr/bin/awk -f BEGIN { FS="|"; OFS="|"; } { print... (6 Replies)
Discussion started by: harik1982
6 Replies

7. Windows & DOS: Issues & Discussions

2 Questions: replace text in txt file, add text to end of txt file

so... Lets assume I have a text file. The text file contains multiple "#" symbols. I want to replace all thos "#"s with a STRING using DOS/Batch I want to add a certain TEXT to the end of each line. How can I do this WITHOUT aid of sed, grep or anything linux related ? (1 Reply)
Discussion started by: pasc
1 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. Programming

Urgent help needed.. C++ program to convert decimal to hexa decimal

Hi , seq can be 0...128 int windex = seq / 8; int bindex = seq % 8; unsigned char bitvalue = '\x01' << (7-bindex) ; bpv.bitmapvalue = bitvalue; This is the part of a program to convert decimal to bitmap value of hexadecimal. I want this to change to convert only to... (1 Reply)
Discussion started by: greenworld123
1 Replies

10. Shell Programming and Scripting

Desired output.txt for reading txt file using awk?

Dear all, I have a huge txt file (DATA.txt) with the following content . From this txt file, I want the following output using some shell script. Any help is greatly appreciated. Greetings, emily DATA.txt (snippet of the huge text file) 407202849... (2 Replies)
Discussion started by: emily
2 Replies
FDK(1)								    Plastimatch 							    FDK(1)

NAME
fdk - cone-beam reconstruction from projections using the FDK algorithm The term FDK refers to the authors Feldkamp, Davis, and Kress who wrote the seminal paper "Practical cone-beam algorithm" in 1984. Their paper describes a filtered back-projection reconstruction algorithm for cone-beam geometries. The fdk program in plastimatch is an implmenetation of the FDK algorithm. FDK USAGE
The fdk program takes a directory of 2D projection images as input, and generates a single 3D volume as output. The command line usage is: Usage: fdk [options] Options: -A hardware Either "cpu" or "brook" or "cuda" (default=cpu) -a "num ((num) num)" Use this range of images -r "r1 r2 r3" Set output resolution (in voxels) -f filter Either "none" or "ramp" (default=ramp) -s scale Scale the intensity of the output file -z "s1 s2 s3" Physical size of the reconstruction (in mm) -I indir The input directory -O outfile The output file -F {F,H} Full or half fan bow-tie filter correction The usage of the fdk program is best understood by following along with the tutorials: fdk_tutorial_i and fdk_tutorial_ii. INPUT FILES
Three different formats of input files are supported. These are: o Pfm format image files with geomtry txt files o Raw format image files with geomtry txt files o Varian hnd files The pfm and raw files are similar, in that they store the image as an array of 4-byte little-endian floats. The only difference is that the pfm file has a header which stores the image size, and the raw file does not. Each pfm or raw image file must have a geometry file in the same directory with the .txt extension. For example, if you want to use image_0000.pfm in a reconstruction, you should supply another file image_0000.txt which contains the geometry. A brief description of the geometry file format is given in proj_mat_file_format. The sequence of files should be stored with the pattern: XXXXYYYY.ZZZ where XXXX is a prefix, YYYY is a number, and .ZZZ is the extension of a known type (either .hnd, .pfm, or .raw). For example the following would be a good directory layout for pfm files: Files/image_00.pfm Files/image_00.txt Files/image_01.pfm Files/image_01.txt etc... The Varian hnd files should be stored in the original layout. For example: Files/ProjectionInfo.xml Files/Scan0/Proj_0000.hnd Files/Scan0/Proj_0001.hnd etc... No geometry txt files are needed to reconstruct from Varian hnd format. IMAGE GEOMETRY
By default, when you generate a DRR, the image is oriented as if the virtual x-ray source were a camera. That means that for a right lat- eral film, the columns of the image go from inf to sup, and the rows go from ant to post. The Varian OBI system produces HND files, which are oriented differently. For a right lateral film, the columns of the HND images go from ant to post, and the rows go from sup to inf. An illustration of this idea is shown in the figure below. [image] Geometry of Varian HND files.UNINDENT AUTHOR
Plastimatch is a collaborative project. For more documentation, please visit http://plastimatch.org. For questions, comments, and bug reports, please visit http://groups.google.com/group/plastimatch. COPYRIGHT
Plastimatch development team (C) 2010-2011. You are free to use, modify, and distribute plastimatch according to a BSD-style license. Please see LICENSE.TXT for details. Plastimatch 1.5 June 11, 2011 FDK(1)
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy