Reads a file in CSV format (comma-separated format) into memory. The function is equivalent to the FileCSVLoad function except that the pointer to the current row is maintained globally between virtual users at one machine. This means that all virtual users of the file at one machine use the same global row pointer for the current row. Therefore you can sequentially access a file from multiple virtual users.
If the file name includes a directory name, the file is opened in the specified directory. Otherwise, Silk Performer searches for the file in the directory where the test script is located, in the data directory, in the results directory and in the project directory.
Kernel.bdh
FileCSVLoadGlobal( out hFile :number, in sFileName : string, in sSeparator : string optional, in sDelimiter : string optional ):boolean;
true if successful
false otherwise
Parameter | Description |
---|---|
hFile | Variable receiving the file handle used to access the file |
sFileName | Specifies the path and file name of the file to read. If you specify a file name without path information, Silk Performer searches for the file in the user data directory specified in the Directories tab of the System Settings - Workbench dialog. |
sSeparator | Specifies the separator of the columns you want to use (optional). Usually the separator for CSV-formatted files is the comma (","). |
sDelimiter | Specifies the delimiter you want to use for identifying a separator/delimiter sign within a data field (optional). By default the delimiter is the double quotes sign ("). |
Name | Nickname | Address | City |
---|---|---|---|
John Smith | John ““The Tester”” | “Fast Lane, 1432” | Test City |
Since double quotes are the delimiter, the double quotes in the Nickname need to be preceded by the delimiter itself (in this case the delimiter has the same functionality as for example a backslash has in BDL code).
The address field includes a comma, which is usually the separator. To prevent FileCSVLoad from using this comma as a separator, the value of John Smith’s address must be encompassed by the delimiter (“…”).
RandomLogin.bdf