I am developing a custom Fixlet which searches for and replaces text within a text file. I have developed similar in the past, but in this case I am receiving a relevance substitution error when taking the action against a computer. I have tweaked the syntax, in terms of quotation marks, brackets, etc. but have been unable to resolve it. I am hoping someone can quickly see my error.
The action command is as follows:
appendfile {concatenation “%0d%0a” of ( if (it contains (parameter “CurrentRegion”)) then ((preceding text of first (parameter “CurrentRegion”) of it) & (“REGION” as a string) & (following text of first (parameter “CurrentRegion”) of it) ) else it ) of lines of file “(parameter “SourceFile”).tmp” }
The two parameters “CurrentRegion” and “SourceFile” are being correctly assigned values, as I can see this in the IEM Client log file.
Incidentally, if I change the end of the command to explicitly state the filename (rather than using a parameter) the Relevance is executed successfully, for example:
appendfile {concatenation “%0d%0a” of ( if (it contains (parameter “CurrentRegion”)) then ((preceding text of first (parameter “CurrentRegion”) of it) & (“REGION” as a string) & (following text of first (parameter “CurrentRegion”) of it) ) else it ) of lines of file “/home/usera/textfile.tmp” }
My syntax must be slightly wrong here, but I don’t see it.
Can anyone help?