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

Re: change one line in a large fine

Thread Previous
From:
Will Mengarini via beginners
Date:
November 20, 2022 10:03
Subject:
Re: change one line in a large fine
Message ID:
Y3n7SlO9v6MpDnzD@eskimo.com
* linuxguy@gmx.net <linuxguy@gmx.net> [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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About