Quantcast
Channel: Silk Performer
Viewing all articles
Browse latest Browse all 4084

Wiki Page: How to overwrite data from a specific column in an external data file within Silk Performer

$
0
0
The BDF script below demonstrates how data from within a specific column from an external data file can be overwritten from within Silk Performer. The script first of all uses the FOpen / FWrite functionality to open and write data to the data file, whilst the FileGet..() functions will read the data file from memory. Within the TMain transaction the FOpen() function is used to load the file with handle “hfile”. Next in order to successfully overwrite the correct data from the correct column, the correct position of the data file needs to be established. Using the nShift parameter within the FCurrentPositionSet() function, i.e. 12, it provides a pointer for the data to be overwritten. For example, if data within the second column of a row needs to be overwritten, then count the number of bytes from the first column until the start of the column in which the data is to be overwritten and include this byte value in the nShift parameter. A variable is then declared which will include data to be written to the file, with the FWrite() function used to write the data. The FClose() function is then used to close the data file. The updated CSV file is then loaded into memory using the FileCSVLoadGlobal() function – new handle declared and used and using the Print / FileGetCol() function, print the updated contents.  You can find the bdf script script attached 7268.OverWrite.zip

Viewing all articles
Browse latest Browse all 4084


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>