Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have special measurement devices which connect through USB to a Windows PC. There's very limited software for those devices which only lets you configure the .txt file where the measured values are saved.

Said software puts every read value (read values are floats from 0 to 15) on the new line of .txt file. The values won't be read frequently (few times in an hour or so).

The software doesn't support timestamps so what we want to accomplish is having timestamps on every line with the time when the value was measured. It doesn't have to be exact time (few minutes there or there).

I was thinking of finding some kind of .txt file monitoring software and then adding current time to last line whenever it sees that file has been changed. What would be the most efficient and free way to accomplish such thing?

share|improve this question
If you could use a .log file instead of a .txt file, I believe it would place timestamps at the start of each line automatically. Is that something it would allow you to do? – Origami Robot Jul 25 '11 at 13:08
Does the application write to the text file at a predictable time? ie every 12, 36, 44, 58 minutes? – n0pe Jul 25 '11 at 13:09
2MaxMackie: No, the measure is done by a human and can be done pretty much any time. Usually few times an hour. – w0rm Jul 25 '11 at 13:20
The easiest way (and it ain't pretty) would be to set up a script to "update the log file" which could run every 10 minutes or so and would write the "Last modified" time for the file at the first character on the last line. This would fail if more than one log would happen within 10 minutes. – n0pe Jul 25 '11 at 13:26
2MaxMackie: We might be able to setup software so the measurement is taken after clicking hotkey on keyboard (e.g. F1) so we could also make that after F1 is clicked, 5seconds later the file is ran through the script (since reading doesn't take more than 5 secods). What kind of scripting would you suggest using? – w0rm Jul 25 '11 at 13:47

You must log in to answer this question.

Browse other questions tagged .