Command failed (Substitution failed while writing file) createfile until EOF

Please review and I am open to any changes including fixing the problem on the first task while reading the csv file.

Background statement
I have created task that runs a vbs script that outputs into a csv file. then the task runs appendfile script that reads that file into a txt file formatted as shown below example into the following directory C:\Program Files (x86)\BigFix Enterprise\BES Client\Patches\installedpatch]

Exerts from Task
appendfile Installed Patches: {concatenation “;” of elements of (set of lines of file “C:\BigFixScripts\installpatch.csv”)}
move __appendfile "{parameter “filename2”}"
copy “{parameter “filename2”}” “{(parent folder of client as string & “\Patches”)}\installwindowpatchfile.yesterday.txt”

Example output file text.
Installed Patches: ;Command line options are saved.;ITEMSERVER,Cumulative Security Update for ActiveX Killbits for Windows Server 2008 x64 Edition (KB2508272),6/28/2011 8:54:02 PM;ITEMSERVER,Cumulative Security Update for ActiveX Killbits for Windows Server 2008 x64 Edition (KB2618451),12/16/2011 2:26:15 PM;

Requested Change
Customer needs me to remove from the txt file the “Command line options are saved.” from the file.

I have created another task for testing that runs the following commands

delete __appendfile
delete __createfile

// start a new __createfile
// Begin the new __createfile removing Command line options are saved line
// Conclude the new __createfile with every line from the original file that does not start with Command line options are saved.
createfile until EOF

{concatenation “%0d%0a” of lines whose (it does not start with “Command line options are saved.”) of file (parent folder of client as string & “\Pathces\installwindowpatchfile.yesterday.txt”)}

EOF

// Now delete the original file
delete “{parent folder of client as string & “\Pathces\installwindowpatchfile.yesterday.txt”}”
//Replace the original file with the new file
move __createfile “{parent folder of client as string & “\Patches\installwindowpatchfile.yesterday.txt”}”

Log file message
Relevant - fix windows install file issue 08162017 (fixlet:5953)
At 08:18:56 -0700 -
ActionLogMessage: (action:5953) Action signature verified for Execution
ActionLogMessage: (action:5953) starting action
At 08:18:56 -0700 - actionsite (http://itemserver.training.tivoli.edu:52311/cgi-bin/bfgather.exe/actionsite)
Command succeeded delete No ‘C:\Program Files (x86)\BigFix Enterprise\BES Client__BESData\CustomSite_NERC_CIP_V5__appendfile’ exists to delete, no failure reported (action:5953)
Command succeeded delete __createfile (action:5953)
Command failed (Substitution failed while writing file) createfile until EOF (action:5953)

I’ll ask the obvious, is this typo of Patches (which was done twice in what was posted) actually part of the action? If so that may be your problem

Thanks for catching that , but corrected version below with still same problem.

delete __appendfile
delete __createfile

// start a new __createfile
// Begin the new __createfile removing Command line options are saved line
// Conclude the new __createfile with every line from the original file that does not start with Command line options are saved.
createfile until EOF
{concatenation “%0d%0a” of lines whose (it does not start with “Command line options are saved.”) of file (parent folder of client as string & “\Patches\installwindowpatchfile.yesterday.txt”)}

EOF

// Now delete the original file
delete “{parent folder of client as string & “\Patches\installwindowpatchfile.yesterday.txt”}”
//Replace the original file with the new file
move __createfile “{parent folder of client as string & “\Patches\installwindowpatchfile.yesterday.txt”}”

I am getting same error when I remove the whose statement as well

{concatenation “%0d%0a” of lines of file (parent folder of client as string & “\Patches\installwindowpatchfile.yesterday.txt”)}

Is the file in the local encoding of the endpoint? So if you’re a windows-1252 machine is the file in that encoding?

Current Date: August 16, 2017
Client version 9.5.4.38 built for WINVER 6.0 i386 running on WINVER 6.0.6002 x86_64
Current Balance Settings: Use CPU: True Entitlement: 0 WorkIdle: 100 SleepIdle: 400
ICU 54.1 init status: SUCCESS
Agent internal character set: UTF-8
ICU report character set: UTF-8 - Transcoding Disabled
ICU fxf character set: windows-1252 (Latin 1 / Western European) - Transcoding Enabled
ICU local character set: windows-1252 (Latin 1 / Western European) - Transcoding Enabled
At 10:20:37 -0700 -
Starting client version 9.5.4.38

Yes the file in the local encoding of the endpoint

Anyone have any thoughts or a better way to accomplish the goal

Could you parse the csv file and remove the offending line before concatenating the lines into the output file text? Maybe to an intermediate csv file?

Would you be able to provide an example. here is a cut and paste from the file

Command line options are saved.
ITEMSERVER Security Update for Windows (KB3217841) 4/13/2017 13:28
ITEMSERVER Security Update for Windows (KB3088195) 11/10/2015 22:35
ITEMSERVER Security Update for Windows (KB3084135) 11/10/2015 22:31

What I need to do is either remove line 1 from the .csv file prior running task or remove line 1 in the .txt file which is now separated by ;.

is there relevance that

{concatenation “%0d%0a” of lines beginning with line 2 ?

@jwgibson949

Try this relevance:

concatenation “;” of (lines of it) whose ((line number of it) > 1) of file (parent folder of client as string & “\Patches\installwindowpatchfile.yesterday.txt”)

I just noticed that your sample file has no commas. Was that just an oversight?