TuMiM Posted February 5, 2007 Share Posted February 5, 2007 Is there a way to use filewrite to write a line of text to the beginning and end of a text file? Link to comment Share on other sites More sharing options...
xcal Posted February 5, 2007 Share Posted February 5, 2007 _FileReadToArray _ArrayInsert _ArrayAdd _FileWriteFromArray How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 5, 2007 Moderators Share Posted February 5, 2007 _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. Link to comment Share on other sites More sharing options...
randallc Posted February 5, 2007 Share Posted February 5, 2007 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 ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
xcal Posted February 6, 2007 Share Posted February 6, 2007 _FileWriteToLine()Woops, ya. Didn't realize that function would bump stuff down. How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now