Jump to content

Writing to an exact Ln, Col of a file


Freedom-n-Democrazy

Recommended Posts

Possible? yes.

You'll probably have to read the entire text file into a variable, split it into lines, find the line you want, split it into columns, write your changes, then save the whole thing back into the text file. As long as you know how the text file is structured, it should be quite easy. (although not very practical, and error prone)

You could use file(), then select the line from the resulting array.  You would then have to know the file specifics in order to be able to explode() the line down to get the right column.

 

After all of this, you would need to put it all back together, and file_put_contents().

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.