Posted Thu, 30 Jul 2020 23:17:47 GMT by

Good afternoon everyone.  I'm having an issue with an XML file created by Automate Premium 11.3.10.65.  I've tried many things but nothing is giving the exact results needed.  The task creates a XML file from a dataset using the commands:

<AMVARIABLE NAME="varXml" VALUE="" />
<AMFILESYSTEM ACTIVITY="csv_to_dataset" SOURCE="D:\temp\file.csv" RESULTDATASET="row" DELIMITER="|" />
<AMXML ACTIVITY="dataset_to_xml" RESULTDATASET="row" RESULTVARIABLE="varXml" />
<AMFILESYSTEM ACTIVITY="write_file" FILE="d:\temp\process.xml" ENCODING="utf-8" APPEND="no">%varXml%</AMFILESYSTEM>

 

The XML file is created and has this in the first line:
<?xml version="1.0" encoding="UTF-8"?><AutoMateDataset><row>


My dev team needs the <AutoMateDataset>  in that first line to actually be the word <delimited>.


How can I change this field in the XML file?

Thanks in advance!  

 

Posted Thu, 06 Aug 2020 22:13:49 GMT by

Hello Debi,

One suggestion is since you are writing the data, you can modify the text before writing it. Here is an example of how to replace text:

<AMVARIABLE NAME="varNew" VALUE="" />
<AMVARIABLE NAME="varXml" VALUE="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;AutoMateDataset&gt;&lt;row&gt;" />
<AMTEXT ACTIVITY="replace" TEXT="%varXml%" FIND="AutoMateDataset" REPLACE="delmited" RESULTVARIABLE="varNew" />
<AMSHOWDIALOG>%varNew%</AMSHOWDIALOG>

 

You must be signed in to post in this forum.