Solved

convert microseconds into hours munites and seconds using awk.

Posted on 2008-06-16
3
1,313 Views
Last Modified: 2013-12-26
how can i convert a long int value(time in microseconds) into hours munites and seconds using awk.
0
Comment
Question by:techass
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 21798102
awk '{printf"%02d:%02d:%02d\n",$1/3600000000,$1/60000000%60,$1/1000000%60}'
0
 

Author Comment

by:techass
ID: 21803379
yes but if also I could convert the time in mks into hh:mm:ss.ms (where ms is miliseconds ). Also I need to print other columns too. $2, $3.. so on.
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 21804023
awk '{$1=sprintf("%02d:%02d:%02d.%03d",$1/3600000000,$1/60000000%60,$1/1000000%60,$1/1000%1000); print}'

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
countEvens challenge 2 113
Fibonacci challenge 11 136
Remove Password Protection from pdf (with password) using an command line executable 5 81
Problem to App source 6 92
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question