tannerli Posted October 19, 2007 Posted October 19, 2007 (edited) I had to do this at my workplace, if someone can use it... feel free to use it, but please do share any improvements and give me some feedback.Performance:I tested the function on a quit actual workstation (HP dc5700).I used a txt-file with about 1.3million characters and I had to make 291'000 replacements.The conversion took about 26secondsGreetings tannerliUPDATE:I had to to even more statistics and reporting so I needed more functions to edit list and logfiles and I created these functions:_FileLineAdd() ; Add a character or string to each line of a file_FileLineSub() ; Cut a number of characters from all lines in a file_FileCharacterReplace() ; Replace a certain character in a file_FileDeleteLine() ; Delete all lines containing a certain substring in a file_FileExtractLine() ; Extract all lines containing a certain substring in a fileFileCharacterReplace.au3FileConversion.au3Please report any experiences and bugs to me Edited May 21, 2008 by tannerli
Valuater Posted October 19, 2007 Posted October 19, 2007 Looks Nice!!! Maybe, For smaller files... MsgBox(0x0,"",_FileCharacterReplace("C:\test.txt", ".", "[dot]")) Func _FileCharacterReplace($file, $search, $replace) Return FileWrite($file & ".txt", StringReplace(FileRead($file), $search, $replace)) EndFunc 8)
tannerli Posted October 20, 2007 Author Posted October 20, 2007 30downloads and only 1 comment.... however... Thx to Valuater for his comment, and maybe just as a Tipp: Check the size of the file before you start a conversion, if its too big then it may take quite long
James Posted May 21, 2008 Posted May 21, 2008 Nice Very quick! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
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