Are you having trouble dealing with the “Time” column in the CSV file that you exported from an Agilent logic analyzer? Even with gigabytes of data, the batch file below corrects all the times in a few seconds. Pun not intended. The corrected file will have all those original times in seconds, as just a number, with the engineering units removed. The “Times” header will change to “Seconds”. The data in the other columns is not changed.
Agilent Technologies was spun off from the Hewlett Packard Company in 1999. The division that makes logic analyzers was spun off from Agilent Technologies and became Keysight Technologies in 2014.
Files with a CSV extension are comma-separated value database files.
The “Time” column in those CSV files is originally formatted with engineering units in seconds, milliseconds, microseconds and nanoseconds. Some examples of those times are
-8.388608 ms
-999.446 us
-374 ns
0 s
626 ns
999.344 us
830.453038 ms
9.876543210 s
Spreadsheet applications cannot deal with these to do time math, sort by time, plot graphs, etc. Here is the latest fix, updated on 2015/6/12:
How to use the batch file link above
- First, click on, copy and paste the text of the text file above into an empty text-editor window such as Notepad.
- Save that text by the name “InSeconds.bat” into the folder containing your CSV files. You could optionally save it into the Binary Filters’ SR folder.
- After that, you need to use this link to install the Binary Filters on your computer.
- Close any Command Prompt windows that you had opened prior to the installation in step 3.
- Now, open a fresh Command Prompt window (aka CMD or COMMAND) to activate the new path to those binary filters.
- Use the CD command to Change the active Directory to the folder with your CSV files.
- Type the command “InSeconds FileName.CSV”, changing FileName to the name of your CSV file.
- Type “EXIT” when you are done using the Command Prompt window.
The Result
Your directory will now have a new file named “InSeconds.csv“. Rename it before running the batch file again.
InSeconds.csv can now be sorted by time as a spreadsheet or as text, plus time math became possible. All times will include a decimal-point followed by 9 digits. Spreadsheet programs will recognize all times as floating-point numbers.
Known Limitations
- The “Time” must be the first column of data.
- Time engineering units must use all lower-case.
- Non-zero picoseconds are not handled.
- The input file may not be named tmp.csv.
– Gareth B. Dolby
Can you please forward me the code for this script or please let know me in detail concerning this script?
I have now posted the script as its own page to make it easy for you to grab from the website.
I would like to thank you for the effort you have put into publishing this post. In fact your writing has me wanting to begin my own blog now. Thanks again for taking the time to put this online.
Just wanted to give you a shout from the valley of the sun, great information. Much appreciated.
I admire the dear knowledge you be offering on your articles. I can bookmark your blog and have my children test up right here generally. I am quite sure they will learn lots of new stuff here than any one else!
I will right away take hold of your rss as I can not to find your email subscription hyperlink or newsletter service. Do you’ve any? Kindly allow me know in order that I may just subscribe. Thanks.
Great article it is definitely. My teacher has been seeking for this update.
Can I simply say what a reduction to find somebody who really knows what theyre talking about on the internet. You definitely know methods to deliver a problem to gentle and make it important. More folks need to learn this and understand this aspect of the story. I cant believe youre no more in style since you definitely have the gift.
My brother recommended I might like this web site. He was totally right. This post truly made my day. You cann
relevant of a post i do have to admit that i do read alot of these a day but will defitenlely stay up to date with any new info and thanks for the blog ..
I got this site from my buddy who shared with me about
this site and now this time I am visiting this web site and reading very
informative content at this place.