Modify

Opened 14 years ago

Closed 14 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@… 14 years ago.
the textfile that is read incorrect

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by bergedorf@…

the textfile that is read incorrect

comment:1 follow-up: Changed 14 years ago by jchd

That file uses @LF as line termination.

comment:2 in reply to: ↑ 1 Changed 14 years ago by bergedorf@…

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 Changed 14 years ago by anonymous

@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 Changed 14 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.