Jump to content
Sign in to follow this  
TuMiM

Filewrite to beginning and end of file

Recommended Posts

_FileReadToArray

_ArrayInsert

_ArrayAdd

_FileWriteFromArray

_FileWriteToLine()

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Hi,

;filewriteBegEnd.au3
$filename=@ScriptDir&"\test.txt"
FileDelete($filename)
FileWrite($filename, "OldLine1"& @CRLF&"OldLine2")
$s_FileInit = FileRead($filename)
FileDelete($filename)

$h_file = FileOpen("test.txt", 2);then fileopen in append  mode
FileWrite($h_file, "LinebAtStart"& @CRLF) ;write first line 
FileWrite($h_file, $s_FileInit & @CRLF); append the rest of the initial file
FileWrite($h_file, "LineEnd"); append last line
FileClose($h_file)
MsgBox(0,"","File ="& @CRLF& FileRead($filename))

Else, if it is a huge file, use tailRW , link from my sig.

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...