Thursday, July 31, 2014

How to change decimal numbers to integers in a column of a file in Unix

If you have file with 5 columns and want to change last 5th column from decimal to integer use awk:

awk '{print $1,$2,$3,$4,int($5)}' file.txt > file_integer.txt

No comments:

Post a Comment