Hello,
Me again with another question.
I am trying to read the contents of a txt file with the $read function and store it as a var with the populate variables processor.
I have this configured as:
set user variable %s_watermark% to $read("%recursed_path~1\watermark.txt)
I can see this gets picked up in the logs as:
"split_id": "1-0-0",
"event": "pre_evaluation",
"type": "trace",
"context": "node execution",
"host": "redacted",
"data": {
"name": "s_watermark",
"data": "_MyFileRead(\"foldername\\watermark.txt\")"
}
But the data then looks empty:
"split_id": "1-0-0",
"event": "populate_variable",
"type": "trace",
"context": "node execution",
"host": "redacted",
"data": {
"name": "s_watermark",
"type": "string",
"data": ""
}
Any ideas what I am doing wrong, the file is there and with some text in. Am I missing some key step to have the txt file contents read and stored?
Thank you,
Neil
$read function usage
Re: $read function usage
Is there really a quote missing in this?
Code: Select all
$read("%recursed_path~1\watermark.txt)
emcodem, wrapping since 2009 you got the rhyme?
Re: $read function usage
Sorry, that's my mistake. I am using:
$read("%s_recursed_path~1%\watermark.txt")
$read("%s_recursed_path~1%\watermark.txt")
Re: $read function usage
My mistake, I forgot to pass the full path in, the recursed path didn't include the host/initialpath.