DIAdem Help

Method: GetLineFeed for File

  • Updated2024-09-12
  • 2 minute(s) read

Method: GetLineFeed for File

Determines the line end character in the file.

This method recognizes the characters Cr (carriage return), Lf (line feed), and the character combination CrLf (carriage return - line feed). If the file uses a different line end character or if there is no recognizable line end in the search area, the method displays an error message and the return value contains an empty string.

sGetLineFeed = Object.GetLineFeed(StartPosition, NrOfBytes)
ObjectFile
Object with this method
StartPositionDouble
Specifies from which position in the file the line end character is determined.
If the position is not specified, the method starts determining at the current file position.
NrOfBytesLongInteger
Specifies how many bytes specify the line end character. The default value is 1024.
Please remember that in the Unicode format one character has two bytes.
sGetLineFeedString
Contains the line end character.

The following example shows the settings required for reading the lines listed below:

28.06.2004 16:28:20; 0,00123428.06.2004 16:28:21; 0,00239828.06.2004 16:28:22; 0,00129628.06.2004 16:28:23; 0,00162828.06.2004 16:28:24; 0,001683

The GetLineFeed method determines the line end character of the file.

File.Formatter.TrimCharacters = " "
File.Formatter.LineFeeds  = File.GetLineFeed()
File.Formatter.TimeFormat = "DD.MM.YYYY hh:mm:ss"
File.Formatter.Delimiters = ";"
File.Formatter.DecimalPoint = ","
Dim ValueTime, Value
While File.Position <> File.Size
  Set ValueTime = File.GetNextStringValue(eTime)
  Value = File.GetNextStringValue(eR64)
  Call Fill.SkipLine()
Wend

Log in to get a better experience