Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove after decimal place and switch fields

Status
Not open for further replies.

jkluesner

Technical User
Sep 29, 2006
24
US
Hello all,

I am needing to take a data set (see below) and delete the decimal digits on the second field and then switch the two fields.

Thanks!!

2.53993 6.65588
2.53591 43.4191
2.53671 63.2147
2.54153 94.3221
2.54876 136.741
2.55117 153.709
2.56000 184.816
2.56401 238.547
2.56722 292.278
2.57365 368.632
2.58328 402.568
2.59292 419.535
2.60175 430.847
2.60014 461.955
2.59854 504.374
 
Try...
Code:
awk '{printf "%d %s\n", $2, $1}' file1 > file2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top