Concatenation with variable field

(imported topic written by trdsmith91)

I am trying to replace text within an XML file on a workstation. Normally it is quite simple to append new data replacing the original data within the file. This time I am trying to replace the data within the XML file with a variable of whatever the hostname is on the workstation. My previous action script doesn’t work for this. Suggestions please?

Below is my text:

parameter “filename” = “C:\frustrating.xml”

appendfile {concatenation “%0d%0a” of (if (it contains " workstationid") then " {computer name}" else it as string) of lines of file (parameter “filename”)}

Any help would be greatly appreciated.

(imported comment written by SystemAdmin)

You can concatenate them to get the string:

appendfile {concatenation “%0d%0a” of (if (it contains " workstationid") then " " & computer name & “” else it as string) of lines of file (parameter “filename”)}

(imported comment written by trdsmith91)

Thank you so much! That worked perfectly. I knew it was something like that and couldn’t put my finger on it. Thanks again!