11-05-2009 01:06 AM
Hello,
for my test application i want to store the test data into a text file with header. This should be like this:
name, serial, count, min. current, max. current
Mister Smith
1234567890
111
10
1000
data:
1 345 34
2 355 23
3 360 34
...
The first row are only informations about the headers rows. "data:" is the start marker of the data. The data consists of a number, the mean value of current an the test time in s.
Now i write an string array to the text file, but if the length of the header change i overwrite the data. For example the name is Mister John Smith.
In my program i can create a new file with header and i can change the header later. In the measurement routine i put the data into the file.
How can I solve this?
thankyou
schwede
Solved! Go to Solution.
11-05-2009 01:45 AM
Hi Schwede,
the easiest would be to disallow changing the header after start of the measurement. (That's reasonable, don't you think so?)
The next best option is to use a fixed-sized header - easiest when you need to change the header later on.
A 3rd option is to reload the whole file, change the header and write the whole file again - there is no "insertion" possible for files...
11-05-2009 01:54 AM
Hello,
"The next best option is to use a fixed-sized header - easiest when you need to change the header later on."
How can I do this?
11-05-2009 02:05 AM
11-05-2009 04:22 AM
I think the constant Header size is good, but i can`t made it.
Have you an example for me please?
11-05-2009 04:41 AM