develooper Front page | perl.beginners | Postings from November 2022

Re: change one line in a large fine

Thread Previous
Will Mengarini via beginners
November 20, 2022 10:03
Re: change one line in a large fine
Message ID:
* <> [22-11/20=Su 09:58 +0100]:
> I have a large file which has millions of lines.  They are text
> only lines.  If I have to change one line in the file, what's the
> efficient way?  I don't want to slurp the whole file into memory,
> change that line and write the full content back to disk again.

See the built-in functions sysopen, sysread, sysseek, syswrite.

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About