Modify

Opened 16 years ago

Closed 16 years ago

#1540 closed Bug (No Bug)

_FileReadToArray bug?

Reported by: bergedorf@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.0 Severity: None
Keywords: Cc:

Description

_FileReadToArray reads only 2 lines of my textfile.

$Local_FileName = "drucker_log.txt"
DATEI_TO_STRING($Local_FileName)

; datei einlesen
Func DATEI_TO_STRING($Local_File)

	Local $DateiArray
	$OldPath = @ScriptDir & "/" & $Local_File

	_FileReadToArray($OldPath, $DateiArray)
	
	ConsoleWrite("Zeilen: " & $DateiArray[0] & @crlf)
	
	For $x = 1 To $DateiArray[0]
		ConsoleWrite('Datensatz ' & $DateiArray[$x] & @crlf)
	Next	
EndFunc

i add my textfile.

Attachments (1)

drucker_log.txt (15.5 KB ) - added by bergedorf@… 16 years ago.
the textfile that is read incorrect

Download all attachments as: .zip

Change History (5)

by bergedorf@…, 16 years ago

Attachment: drucker_log.txt added

the textfile that is read incorrect

comment:1 by jchd, 16 years ago

That file uses @LF as line termination.

in reply to:  1 comment:2 by bergedorf@…, 16 years ago

Replying to jchd:

That file uses @LF as line termination.

so its no bug of _FileReadToArray() ?

but if it is not a bug, is there a method to read the whole file into an array?

comment:3 by anonymous, 16 years ago

@bergedorf:
PS: Use the forum for your question. (More readers, faster response)
If it turns out to be a bug after all you can just update this ticket again.

comment:4 by Valik, 16 years ago

Resolution: No Bug
Status: newclosed

It has nothing to do with @LF. It has everything to do with all the lines except the first being prefixed with the NULL character. This is not a bug in _FileReadToArray(). You just have a binary file, not a text file.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.