randallc Posted August 23, 2006 Share Posted August 23, 2006 (edited) Hi, [this attempt was superceded by further version at following post;APITailRW.zip]Derived from Larry's (cf Zedna) UDF API.1. Read any tail very fast.2. write to any tail line very fast.3. Write to any line very fast (especially if trim to NOT change file length! 30msec most huge files) , but also with "individual" line replace or insert (10x as fast, say, as _fileWriteLine rto an individual line).Best, Randall[demo for somebody to do proper UDF perhaps?];ReadLine3.au3 #include "TailRW.au3" $s_Test = FileOpenDialog("Choose File", @ScriptDir, "Files (*.exe;*.dll;*.txt)", 1) Local $i_WriteLineNumTail = 10 $timer2 = TimerInit() ;~ __FileReadLine($s_File, $i_LineNumber = -1, $i_Beginning = 1,$i_ToEnd=0, $i_BufferSize = 8388608) $s_ReadLine = __FileReadLine ($s_Test, -$i_WriteLineNumTail, 1,1) ;;** READS from the TAIL if Negative line number [to the edn if 4th parm=1] ConsoleWrite("__FileReadLine beginning APIreeadLINE=" & @LF & $s_ReadLine & @LF & Round(TimerDiff($timer2), 1) & "msecs"& @LF) Edited May 3, 2008 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Zedna Posted December 3, 2006 Share Posted December 3, 2006 nice and very usefull UDF Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
randallc Posted December 3, 2006 Author Share Posted December 3, 2006 nice and very usefull UDF OK!Thanks again to you and Larry for showing how..Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
flyingboz Posted March 21, 2007 Share Posted March 21, 2007 @randall -- i didn't notice that you were referencing the API in TailRW... at some point i'd love to see au3 expose the pointer so we can write to an arbitrary location in a file natively, that method would likely be as fast or faster than tail...one day when i'm bored i'll speed check. Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
randallc Posted March 21, 2007 Author Share Posted March 21, 2007 (edited) Hi, Yes, that was Zedna's addition to Larry's API read/ write udf; you will see I included it in TaiRW; "_APIFileSetPos($hFile, $nPos)" Best, Randall Edited March 21, 2007 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Gigglestick Posted May 3, 2007 Share Posted May 3, 2007 EXACTLY what i needed for quickly parsing the summaries at the end of dozens of robocopy logs that are many MBs in size. THANKS! My UDFs: ExitCodes 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