Im new with PHP, however I am pretty decent with scripting....
Im working with flat files now, as I do not have access to MySQL databases.

My question is, is it possible to overwrite a single line by its id in a text file?

EG: ?action=edit&id=2

What is a code I can use to overwrite the data in the row, where its id is two?
This is what each row looks like:
1\|COMMENT\|IP\|DATE
2\|COMMENT\|IP\|DATE

What is a script or function that I can use to edit the row with the selected id in the url?

Thank you,
PHP n00b (sorta)