Method: GetLineFeed for File
- Updated2024-09-12
- 2 minute(s) read
DataPlugin > Methods > Method: GetLineFeed for File
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)
| Object | File Object with this method |
| StartPosition | Double 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. |
| NrOfBytes | LongInteger 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. |
| sGetLineFeed | String 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,001234¶ 28.06.2004 16:28:21; 0,002398¶ 28.06.2004 16:28:22; 0,001296¶ 28.06.2004 16:28:23; 0,001628¶ 28.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