Advertisement
Guest User

Untitled

a guest
May 27th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. text - 0.1655456615 - 0.158645 - 0.846554 - 0.85251 ##
  2.  
  3. perl -pe 's/[-+]?d*(?:.?d|d.)d*(?:[eE][-+]?d+)?/sprintf("%.2g",$&)/ge'
  4.  
  5. awk '{
  6. while (match($0, /[0-9]+.[0-9]+/)) {
  7. printf "%s%.2f", substr($0, 1, RSTART-1), substr($0, RSTART, RLENGTH)
  8. $0 = substr($0, RSTART+RLENGTH)
  9. }
  10. print
  11. }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement