Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- awk '{
- for(i=1; i<=NF; i++) {
- tmp=match($i, /^[0-9]*s[0-9]*ms$/)
- tmp2=match($i, /^[0-9]*ms$/)
- if(tmp) {
- j = index($i, "s")
- k = index($i, "ms")
- seconds = substr($i, 0, j-1)
- miliseconds = substr($i, j+1, k-j-1)
- newtime = seconds + miliseconds/1000
- printf("%.02f ", newtime)
- } else if (tmp2) {
- k = index($i, "ms")
- miliseconds = substr($i, 0, k-1)
- newtime = miliseconds/1000
- printf("%.02f ", newtime)
- }
- else {
- printf $i " "
- }
- }
- printf "\n"
- }' $1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement