Hmm this should probably go into the newbies forum.
How are you going to be editing this, are you going to select a row, or is the file open to be read and editied that way :s
At the moment there are two ways first way is simply selecting the row and just changing the text..
$row = 5;
$file = file("mytext.txt"); //$file is now an Array
//we are looking for row 5 which is index 4
$replacement = 'Test,Test6';
$file[($row-1)] = $replacement;
//make it on newlines
$theFile = implode("\n",$file);
//now open the file to replace
$fp = fopen("mytext.txt","a");
fwrite($fp,$theFile);
fclose($fp);
Not sure if thats what you want, this also isnt tested so you will need to modify it