Get Binary File Text
Verb: binaryReadString
Available from: <Standard>
This command is used to get a text from a binary file.
The command interprets all file types (.txt, .html, .pdf, ...) as binary.
Syntax
binaryReadString --file(BinaryFileReader) (String)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--file | Binary reader | Required | Binary File Reader | Binary file, opened by the Open Binary File for Reading command, from which the text should be obtained. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Text | Text | Text obtained from the binary file. |
Example
The command gets a text in binary, using the Open Binary File for Reading to open and read the file.
defVar --name binaryReader --type BinaryFileReader
defVar --name valueText --type String
//Open the file informed for reading.
//Download the following file to execute the command.
openBinaryReader --share "Read" --path "binaryFile.txt" --encoding "Default" binaryReader=value
//Get text contained in file.
binaryReadString --file ${binaryReader} valueText=value
//Returns the text.
logMessage --message "${valueText}" --type "Info"
//Close the binary file.
binaryFileClose --file ${binaryReader}
For the correct operation of the script above, it is necessary to download the file and enter its path in the "Path" parameter of the "Open Binary File to Read" command.
Remarks
For the Get Binary File Text command to work correctly, a file with a binary text is needed.
The Binary reader parameter uses the variable that is generated by the Open Binary File for Reading command, which holds the file containing the binary value.