Jump to content
Sign in to follow this  

Need a _FileInsert function or udf

Recommended Posts

I'm dealing w/ some large text files, and need a methodology to insert /replace text in an arbitrary location within the file. I've searched the forum, but have not seen a methodology to insert or replace text at an arbitrary location within a file that does not depend on reading the file into memory first.

While _FileWriteToLine() is useful w/ small files, the need to read the file into memory before editing it imposes an unacceptable performance hit in my situation.

I'm hoping that someone has a DllCall() for this capability lying around, and would be happy to post what they've got, or I can start poking around at MSDN to try to grow my own.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post

Link to post
Share on other sites


See link in my signature "TailRW.au3"; I fixed larry's dll call to make it; make your own if you use his APIread/write

Mine doesn't only do "tail read write"

; also wites to lines numbered either from end or start, quicker depending where in the file you are writing, and inserts or overwrites;

"insert" is quicker if you don't adjust line length [it will either pad or truncate if you use that option]

Best, randall

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...