Asked by duncanb7
at 2024-04-25 04:39:52
Point:500 Replies:8 POST_ID:828484USER_ID:11059
Topic:
PHP Scripting Language;;JavaScript
I get one simple example csv file such as
1,2,3
4,5,6
7,8,9
Total 10 bytes for each row
And I write php file and if every line's first cell is > 0 then overwrite the same cell value by 0 , So
if php pass, the output should like this
0,2,3
0,5,6
0,8,9
So I used fopen with "r+" option because read and write within the same file
and use fseek() with negative offset to backward file pointer to the previous row
since every row is just 10 byte and I used -10 in fseek() and Ftell() is also report correct file pointer
But the question fseek() could not locate the exact file pointer by the system with the
Warning: fseek() [function.fseek]: stream does not support seeking in www.mydomain.data.php on line
So the output is same as before, so fseek is fail in my php data.php and I also try
rewind() that is also NO any response.
SO anyone know what is the warning meaning ? and I check a lot thing at
http://hk.php.net/manual/en/book.stream.php and
see the stream data method at http://hk.php.net/manual/en/book.stream.php
write a simple data into csv file why it is so difficult. Please advise.
Duncan
1,2,3
4,5,6
7,8,9
Total 10 bytes for each row
And I write php file and if every line's first cell is > 0 then overwrite the same cell value by 0 , So
if php pass, the output should like this
0,2,3
0,5,6
0,8,9
So I used fopen with "r+" option because read and write within the same file
and use fseek() with negative offset to backward file pointer to the previous row
since every row is just 10 byte and I used -10 in fseek() and Ftell() is also report correct file pointer
But the question fseek() could not locate the exact file pointer by the system with the
Warning: fseek() [function.fseek]: stream does not support seeking in www.mydomain.data.php on line
So the output is same as before, so fseek is fail in my php data.php and I also try
rewind() that is also NO any response.
SO anyone know what is the warning meaning ? and I check a lot thing at
http://hk.php.net/manual/en/book.stream.php and
see the stream data method at http://hk.php.net/manual/en/book.stream.php
write a simple data into csv file why it is so difficult. Please advise.
Duncan