Jump to content

Re-write of _FileWriteToLine()


guinness
 Share

Recommended Posts

But look at FileWriteLine() and you will see my point.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

  • Replies 113
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

You are right, Sorry

I thought for better, I do not know I see it as the most logical way, for the reasons said in post before, however that was a choice, to add the @CRLF is simple but i believe is better to add in the option flags, to keep all options open

Ciao.

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Link to comment
Share on other sites

I think should be so (is much simpler as the procedure for the function)

 

#include <FileConstants.au3>
#include <StringConstants.au3>

; #CONSTANTS# ====================================================
#Region ;**** Global vars for _FileWriteToLineEx
Global Const $FRL_NOEOL      = 1
Global Const $FRL_OVERWRITE  = 2
Global Const $FRL_DELETE     = 4
Global Const $FRL_OVERWRITE_DELETE  = BitOR($FRL_OVERWRITE, $FRL_DELETE) ;INTERNALLY USE ONLY
Global Const $FRL_NOEOL_DELETE  = BitOR($FRL_NOEOL, $FRL_DELETE) ;INTERNALLY USE ONLY
#EndRegion ;**** Global vars for _FileWriteToLineEx
; ================================================================

;; CMD line reg export HKLM\SOFTWARE "%UserProfile%\Desktop\SOFTWARE.reg"
;~ $fTimerDiff = TimerInit()
;~ _FileWriteToLineEx(@DesktopDir & '\software.reg', ';This is Comment Linexx',2152567)    ;2152567 - offset 133298440
;~ If @Error Then ConsoleWrite("!@Error - " & @error & @CRLF)
;~ $fTimerDiff = TimerDiff($fTimerDiff)
;~ ConsoleWrite($fTimerDiff & @CRLF)

Local $sData
For $i = 1 To 250000
    $sData &= "Name" & $i & " = Value" & $i & @CRLF
Next
FileDelete(@DesktopDir & '\Test.inf')
FileWrite(@DesktopDir & '\Test.inf',$sData)

$fTimerDiff = TimerInit()
_FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line',249996)
If @Error Then ConsoleWrite("!@Error - " & @error & @CRLF)
$fTimerDiff = TimerDiff($fTimerDiff)
ConsoleWrite($fTimerDiff & @CRLF)

$fTimerDiff = TimerInit()
_FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line',249997, $FRL_OVERWRITE)
If @Error Then ConsoleWrite("!@Error - " & @error & @CRLF)
$fTimerDiff = TimerDiff($fTimerDiff)
ConsoleWrite($fTimerDiff & @CRLF)

$fTimerDiff = TimerInit()
_FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line',249998, $FRL_DELETE)
If @Error Then ConsoleWrite("!@Error - " & @error & @CRLF)
$fTimerDiff = TimerDiff($fTimerDiff)
ConsoleWrite($fTimerDiff & @CRLF)

;~ $fTimerDiff = TimerInit()
;~ ;;_FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line',Default,200000)
;~ _FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line 1')
;~ _FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is', Default, $FRL_NOEOL)
;~ _FileWriteToLineEx(@DesktopDir & '\Test.inf', 'Comment Line 2')
;~ If @Error Then ConsoleWrite("!@Error - " & @error & @CRLF)
;~ $fTimerDiff = TimerDiff($fTimerDiff)
;~ ConsoleWrite($fTimerDiff & @CRLF)

; #FUNCTION# ====================================================================================================================
; Name...........: _FileWriteToLineEx
; Description ...: Edit a specific line in a file.
; Syntax.........: _FileWriteToLineEx($sFilePath, $sText[, $iLine[, $iFlags]] )
; Parameters ....: $sFilePath - The File Path
;                  $sText     - The text to write
;                  $iLine     - The line number to edit to (Default edit last line), Use a negative occurrence to search line from the right side
;                  $iFlags    - Optional, Flag to indicate the type of stripping that should be performed
;                  |  Default FileWriteLine Mod, The line of text to write to the text file. If the line does NOT end in @CR or @LF
;                  |   then a DOS linefeed (@CRLF) will be automatically added.
;                  |$FRL_NOEOL     (1) - Disable check for @CR or @LF (do not add @CR or @LF if there are not present)
;                  |$FRL_OVERWRITE (2) - overwrite the old line
;                  |$FRL_DELETE    (4) - delete\remove the line
; Return values .: If the function succeeds, it returns TRUE; otherwise, FALSE.
;                  @error  - 0 = No error
;                  |1 = File does not exist
;                  |2 = File has less lines than $iLine
;                  |3 = Error when opening file, should be ERROR_ACCESS_DENIED = 5 (0x5) Access is denied. ($sFilePath is ReadOnly or has not Security Access Rights)
; Author ........: DXRW4E
; ===============================================================================================================================
Func _FileWriteToLineEx($sFilePath, $sText, $iLine = Default, $iFlags = 0)
    If Not FileExists($sFilePath) Then Return SetError(1, 0, False)
    If Not $iLine Then $iLine = -1
    Local $EOL, $iOffSet = 0, $_iOffSet, $sData = FileRead($sFilePath)
    ;;$EOL = StringMid($sData, StringInStr($sData, @CR, $STR_CASESENSE, 1) + 1, 1) = @LF ? @LF : @CR    ;;@CR has priority
    $EOL = StringInStr($sData, @LF, $STR_CASESENSE, 1) ? @LF : @CR    ;;@LF has priority
    If $iLine <> 1 Then
        $iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, ($iLine < 0 ? $iLine : $iLine - 1))
        If Not $iOffSet Then Return SetError(2, 0, False)
    EndIf
    $_iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, 1, $iOffSet + 1)
    If Not $_iOffSet Then
        $_iOffSet = StringLen($sData)
        If Not BitAND($iFlags, $FRL_NOEOL_DELETE) And StringRight($sText, 1) <> $EOL Then $sText &= ($EOL = @CR ? @CR : @CRLF)
    ElseIf Not BitAND($iFlags, $FRL_DELETE) Then
        $_iOffSet -= ($EOL = @CR ? 1 : 1 + Number(StringMid($sData, $_iOffSet - 1, 1) == @CR))
    EndIf
    If Not BitAND($iFlags, $FRL_OVERWRITE_DELETE) Then $iOffSet = $_iOffSet
    Local $hFileOpen = FileOpen($sFilePath, FileGetEncoding($sFilePath) + $FO_OVERWRITE)
    If $hFileOpen = -1 Then Return SetError(3, 0, False)
    FileWrite($hFileOpen, StringLeft($sData, $iOffSet) & (BitAND($iFlags, $FRL_DELETE) ? "" : $sText) & StringTrimLeft($sData, $_iOffSet))
    FileClose($hFileOpen)
    Return True
EndFunc   ;==>_FileWriteToLineEx


Func _FileWriteToLineB(ByRef $sData, $sText, $iLine = Default, $iFlags = 0)
    If Not $sData Then Return SetError(1, 0, False)
    If Not $iLine Then $iLine = -1
    Local $EOL, $iOffSet = 0, $_iOffSet
    $EOL = StringInStr($sData, @LF, $STR_CASESENSE, 1) ? @LF : @CR    ;;@LF has priority
    If $iLine <> 1 Then
        $iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, ($iLine < 0 ? $iLine : $iLine - 1))
        If Not $iOffSet Then Return SetError(2, 0, False)
    EndIf
    $_iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, 1, $iOffSet + 1)
    If Not $_iOffSet Then
        $_iOffSet = StringLen($sData)
        If Not BitAND($iFlags, $FRL_NOEOL_DELETE) And StringRight($sText, 1) <> $EOL Then $sText &= ($EOL = @CR ? @CR : @CRLF)
    ElseIf Not BitAND($iFlags, $FRL_DELETE) Then
        $_iOffSet -= ($EOL = @CR ? 1 : 1 + Number(StringMid($sData, $_iOffSet - 1, 1) == @CR))
    EndIf
    If Not BitAND($iFlags, $FRL_OVERWRITE_DELETE) Then $iOffSet = $_iOffSet
    $sData = StringLeft($sData, $iOffSet) & (BitAND($iFlags, $FRL_DELETE) ? "" : $sText) & StringTrimLeft($sData, $_iOffSet)
    Return True
EndFunc   ;==>_FileWriteToLineB
Ciao. Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Link to comment
Share on other sites

Just what I said: compiled pattern too big. BTW, is the pattern studied and would switching to JIT solve the issue with this precise script?

If it interests you I did some testings...

What was really weird to me was that there was no obvious reason for crashes I got after I allowed bigger patterns by changing LINK_SIZE to 4. Then I went thoroughly through head hurting match() function (pcre_exec.c) and figured out what's causing stack owerflow. It's freaking recursion. After I defined NO_RECURSE everything started working correctly.

guinness said he got some crashes so it's very likely they are caused by internal recursion issues as well. Exceptions like that shouldn't be unhandled in AutoIt even if the performance would suffer a bit.

@DXRW4E, very out of the box no matter how obvious now. I like it. :)

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

ok already updated last post when there confusion is a mess, as always in the end everything is simple ehhh

;ect ect ect
    If Not $_iOffSet Then
        $_iOffSet = StringLen($sData)
        If Not BitAND($iFlags, $FRL_DELETE) And StringRight($sText, 1) <> $EOL Then $sText &= ($EOL = @CR ? @CR : @CRLF)
    ;ect ect ect

so if not $_iOffSet the line (where $sText will be added) do not end with @CR or @LF, so them checkadd @CR or @LF in $sText

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Link to comment
Share on other sites

So _FileWriteToLineEx() in #43 is your final code?

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

What was the idea for _FileWriteToLineB()?

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

I was playing for 2 days with DELTA http://msdn.microsoft.com/en-us/library/bb417345.aspx#msdnfunc_apply and I've seen the FuncNameB (Buffer) :) , since there already a FileWriteLine i think the main purpose of _FileWriteLine() is to do something that FileWriteLine does not do, example the option to work with ByRef to edit StringTextData directly from variable ect ect, for this added to them, so just for idea, maybe in the future who knows ehhhh

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Link to comment
Share on other sites

Who knows indeed. Hopefully people will test out your function before I look at implementing it in the UDFs albeit a few changes (if any).

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

If I had to guess you don't have a file in @DesktopDir called Test.inf?

Edit: I will come up with a better testing version.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

TEST THIS PEOPLE PLEASE. (Yes, I am shouting this one!)

#include <FileConstants.au3>
#include <StringConstants.au3>

; #CONSTANTS# ====================================================
#Region ;**** Global vars for _FileWriteToLineEx
Global Const $FRL_NOEOL = 1
Global Const $FRL_OVERWRITE = 2
Global Const $FRL_DELETE = 4
Global Const $FRL_OVERWRITE_DELETE = BitOR($FRL_OVERWRITE, $FRL_DELETE) ;INTERNALLY USE ONLY
Global Const $FRL_NOEOL_DELETE = BitOR($FRL_NOEOL, $FRL_DELETE) ;INTERNALLY USE ONLY
#EndRegion ;**** Global vars for _FileWriteToLineEx
; ================================================================

Local $hFileOpen = FileOpen(@ScriptDir & '\Test.txt', $FO_OVERWRITE)
For $i = 1 To 100000
    FileWriteLine($hFileOpen, $i)
Next
FileClose($hFileOpen)

Local $hTimer = TimerInit()
_FileWriteToLineEx(@ScriptDir & '\Test.txt', ';This is Comment Line 1')
If @error Then ConsoleWrite(@error & @CRLF)

_FileWriteToLineEx(@ScriptDir & '\Test.txt', ';This is', Default, $FRL_NOEOL)
If @error Then ConsoleWrite(@error & @CRLF)

_FileWriteToLineEx(@ScriptDir & '\Test.txt', 'Comment Line 2', 9999)
If @error Then ConsoleWrite(@error & @CRLF)
ConsoleWrite(TimerDiff($hTimer) & @CRLF)

; #FUNCTION# ====================================================================================================================
; Name...........: _FileWriteToLineEx
; Description ...: Edit a specific line in a file.
; Syntax.........: _FileWriteToLineEx($sFilePath, $sText[, $iLine[, $iFlags]] )
; Parameters ....: $sFilePath - The File Path
;                  $sText     - The text to write
;                  $iLine     - The line number to edit to (Default edit last line), Use a negative occurrence to search line from the right side
;                  $iFlags    - Optional, Flag to indicate the type of stripping that should be performed
;                  |  Default FileWriteLine Mod, The line of text to write to the text file. If the line does NOT end in @CR or @LF
;                  |   then a DOS linefeed (@CRLF) will be automatically added.
;                  |$FRL_NOEOL     (1) - Disable check for @CR or @LF (do not add @CR or @LF if there are not present)
;                  |$FRL_OVERWRITE (2) - overwrite the old line
;                  |$FRL_DELETE    (4) - delete\remove the line
; Return values .: If the function succeeds, it returns TRUE; otherwise, FALSE.
;                  @error  - 0 = No error
;                  |1 = File does not exist
;                  |2 = File has less lines than $iLine
;                  |3 = Error when opening file, should be ERROR_ACCESS_DENIED = 5 (0x5) Access is denied. ($sFilePath is ReadOnly or has not Security Access Rights)
; Author ........: DXRW4E
; ===============================================================================================================================
Func _FileWriteToLineEx($sFilePath, $sText, $iLine = Default, $iFlags = 0)
    If Not FileExists($sFilePath) Then Return SetError(1, 0, False)
    If Not $iLine Then $iLine = -1
    Local $EOL, $iOffSet, $_iOffSet, $sData = FileRead($sFilePath)
    ; $EOL = StringMid($sData, StringInStr($sData, @CR, $STR_CASESENSE, 1) + 1, 1) = @LF ? @LF : @CR    ;;@CR has priority
    $EOL = StringInStr($sData, @LF, $STR_CASESENSE, 1) ? @LF : @CR ;;@LF has priority
    If $iLine = 1 Then
        $iOffSet = BitAND($iFlags, $FRL_OVERWRITE_DELETE) ? 0 : StringInStr($sData, $EOL, $STR_CASESENSE, 1)
    Else
        $iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, ($iLine < 0 ? $iLine : $iLine - 1))
        If Not $iOffSet Then Return SetError(2, 0, False)
    EndIf
    $_iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, 1, $iOffSet + 1)
    If Not $_iOffSet Then
        $_iOffSet = StringLen($sData)
        If Not BitAND($iFlags, $FRL_NOEOL_DELETE) And StringRight($sText, 1) <> $EOL Then $sText &= ($EOL = @CR ? @CR : @CRLF)
    ElseIf Not BitAND($iFlags, $FRL_DELETE) Then
        $_iOffSet -= ($EOL = @CR ? 1 : 1 + Number(StringMid($sData, $_iOffSet - 1, 1) == @CR))
    EndIf
    If Not BitAND($iFlags, $FRL_OVERWRITE_DELETE) Then $iOffSet = $_iOffSet
    Local $hFileOpen = FileOpen($sFilePath, FileGetEncoding($sFilePath) + $FO_OVERWRITE)
    If $hFileOpen = -1 Then Return SetError(3, 0, False)
    FileWrite($hFileOpen, StringLeft($sData, $iOffSet) & (BitAND($iFlags, $FRL_DELETE) ? "" : $sText) & StringTrimLeft($sData, $_iOffSet))
    FileClose($hFileOpen)
    Return True
EndFunc   ;==>_FileWriteToLineEx

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Oops, heh, but now with Test.inf on the desktop I get this:

2

1.07444

I need more, what did you use, but also see above this post as well. Thanks.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

need to test it, stressing it ect ect, example

#include <FileConstants.au3>
#include <StringConstants.au3>

; #CONSTANTS# ====================================================
#Region ;**** Global vars for _FileWriteToLineEx
Global Const $FRL_NOEOL      = 1
Global Const $FRL_OVERWRITE  = 2
Global Const $FRL_DELETE     = 4
Global Const $FRL_OVERWRITE_DELETE  = BitOR($FRL_OVERWRITE, $FRL_DELETE) ;INTERNALLY USE ONLY
Global Const $FRL_NOEOL_DELETE  = BitOR($FRL_NOEOL, $FRL_DELETE) ;INTERNALLY USE ONLY
#EndRegion ;**** Global vars for _FileWriteToLineEx
; ================================================================

Local $sData
For $i = 1 To 250000
    $sData &= "Name" & $i & " = Value" & $i & @CRLF
Next
FileDelete(@DesktopDir & '\Test.inf')
FileWrite(@DesktopDir & '\Test.inf',$sData)

$fTimerDiff = TimerInit()
_FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line',249996)
If @Error Then ConsoleWrite(@error & @CRLF)
$fTimerDiff = TimerDiff($fTimerDiff)
ConsoleWrite($fTimerDiff & @CRLF)

$fTimerDiff = TimerInit()
_FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line',249997, $FRL_OVERWRITE)
If @Error Then ConsoleWrite(@error & @CRLF)
$fTimerDiff = TimerDiff($fTimerDiff)
ConsoleWrite($fTimerDiff & @CRLF)

$fTimerDiff = TimerInit()
_FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line',249998, $FRL_DELETE)
If @Error Then ConsoleWrite(@error & @CRLF)
$fTimerDiff = TimerDiff($fTimerDiff)
ConsoleWrite($fTimerDiff & @CRLF)

;~ $fTimerDiff = TimerInit()
;~ ;;_FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line',Default,200000)
;~ _FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is Comment Line 1')
;~ _FileWriteToLineEx(@DesktopDir & '\Test.inf', ';This is', Default, $FRL_NOEOL)
;~ _FileWriteToLineEx(@DesktopDir & '\Test.inf', 'Comment Line 2')
;~ If @Error Then ConsoleWrite(@error & @CRLF)
;~ $fTimerDiff = TimerDiff($fTimerDiff)
;~ ConsoleWrite($fTimerDiff & @CRLF)

; #FUNCTION# ====================================================================================================================
; Name...........: _FileWriteToLineEx
; Description ...: Edit a specific line in a file.
; Syntax.........: _FileWriteToLineEx($sFilePath, $sText[, $iLine[, $iFlags]] )
; Parameters ....: $sFilePath - The File Path
;                  $sText     - The text to write
;                  $iLine     - The line number to edit to (Default edit last line), Use a negative occurrence to search line from the right side
;                  $iFlags    - Optional, Flag to indicate the type of stripping that should be performed
;                  |  Default FileWriteLine Mod, The line of text to write to the text file. If the line does NOT end in @CR or @LF
;                  |   then a DOS linefeed (@CRLF) will be automatically added.
;                  |$FRL_NOEOL     (1) - Disable check for @CR or @LF (do not add @CR or @LF if there are not present)
;                  |$FRL_OVERWRITE (2) - overwrite the old line
;                  |$FRL_DELETE    (4) - delete\remove the line
; Return values .: If the function succeeds, it returns TRUE; otherwise, FALSE.
;                  @error  - 0 = No error
;                  |1 = File does not exist
;                  |2 = File has less lines than $iLine
;                  |3 = Error when opening file, should be ERROR_ACCESS_DENIED = 5 (0x5) Access is denied. ($sFilePath is ReadOnly or has not Security Access Rights)
; Author ........: DXRW4E
; ===============================================================================================================================
Func _FileWriteToLineEx($sFilePath, $sText, $iLine = Default, $iFlags = 0)
    If Not FileExists($sFilePath) Then Return SetError(1, 0, False)
    If Not $iLine Then $iLine = -1
    Local $EOL, $iOffSet, $_iOffSet, $sData = FileRead($sFilePath)
    ;;$EOL = StringMid($sData, StringInStr($sData, @CR, $STR_CASESENSE, 1) + 1, 1) = @LF ? @LF : @CR    ;;@CR has priority
    $EOL = StringInStr($sData, @LF, $STR_CASESENSE, 1) ? @LF : @CR    ;;@LF has priority
    If $iLine = 1 Then
        $iOffSet = BitAND($iFlags, $FRL_OVERWRITE_DELETE) ? 0 : StringInStr($sData, $EOL, $STR_CASESENSE, 1)
    Else
        $iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, ($iLine < 0 ? $iLine : $iLine - 1))
        If Not $iOffSet Then Return SetError(2, 0, False)
    EndIf
    $_iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, 1, $iOffSet + 1)
    If Not $_iOffSet Then
        $_iOffSet = StringLen($sData)
        If Not BitAND($iFlags, $FRL_NOEOL_DELETE) And StringRight($sText, 1) <> $EOL Then $sText &= ($EOL = @CR ? @CR : @CRLF)
    ElseIf Not BitAND($iFlags, $FRL_DELETE) Then
        $_iOffSet -= ($EOL = @CR ? 1 : 1 + Number(StringMid($sData, $_iOffSet - 1, 1) == @CR))
    EndIf
    If Not BitAND($iFlags, $FRL_OVERWRITE_DELETE) Then $iOffSet = $_iOffSet
    Local $hFileOpen = FileOpen($sFilePath, FileGetEncoding($sFilePath) + $FO_OVERWRITE)
    If $hFileOpen = -1 Then Return SetError(3, 0, False)
    FileWrite($hFileOpen, StringLeft($sData, $iOffSet) & (BitAND($iFlags, $FRL_DELETE) ? "" : $sText) & StringTrimLeft($sData, $_iOffSet))
    FileClose($hFileOpen)
    Return True
EndFunc   ;==>_FileWriteToLineEx


Func _FileWriteToLineB(ByRef $sData, $sText, $iLine = Default, $iFlags = 0)
    If Not $sData Then Return SetError(1, 0, False)
    If Not $iLine Then $iLine = -1
    Local $EOL, $iOffSet, $_iOffSet
    $EOL = StringInStr($sData, @LF, $STR_CASESENSE, 1) ? @LF : @CR    ;;@LF has priority
    If $iLine = 1 Then
        $iOffSet = BitAND($iFlags, $FRL_OVERWRITE_DELETE) ? 0 : StringInStr($sData, $EOL, $STR_CASESENSE, 1)
    Else
        $iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, ($iLine < 0 ? $iLine : $iLine - 1))
        If Not $iOffSet Then Return SetError(2, 0, False)
    EndIf
    $_iOffSet = StringInStr($sData, $EOL, $STR_CASESENSE, 1, $iOffSet + 1)
    If Not $_iOffSet Then
        $_iOffSet = StringLen($sData)
        If Not BitAND($iFlags, $FRL_NOEOL_DELETE) And StringRight($sText, 1) <> $EOL Then $sText &= ($EOL = @CR ? @CR : @CRLF)
    ElseIf Not BitAND($iFlags, $FRL_DELETE) Then
        $_iOffSet -= ($EOL = @CR ? 1 : 1 + Number(StringMid($sData, $_iOffSet - 1, 1) == @CR))
    EndIf
    If Not BitAND($iFlags, $FRL_OVERWRITE_DELETE) Then $iOffSet = $_iOffSet
    $sData = StringLeft($sData, $iOffSet) & (BitAND($iFlags, $FRL_DELETE) ? "" : $sText) & StringTrimLeft($sData, $_iOffSet)
    Return True
EndFunc   ;==>_FileWriteToLineB



;~ >Running AU3Check (3.3.10.2)  from:C:\Program Files (x86)\AutoIt3
;~ +>23:23:27 AU3Check ended.rc:0
;~ >Running:(3.3.10.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\DXRW4E\Desktop\_FileWriteToLineEx.au3"    
;~ --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
;~ 329.074475446041
;~ 379.656690057408
;~ 323.429655584237
;~ +>23:23:28 AutoIt3.exe ended.rc:0
;~ >Exit code: 0    Time: 1.442

svqw.png

 

or indicate file with (1-2-3).000.000 of line ect ect

Ciao

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Link to comment
Share on other sites

How did that happen DXRW4E? What happened to the comment on 249998?

Good to see someone else using Notepad2. 

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...