ACL Single filepath data processing vs Batch Files Data processing logic
Currently I am able to execute a basic script to open a file, perform data processing, save then close.
For a batch process though, my thought process is to get the directory path filled with the collection of "*.xml" files, iterate over each file path and perform the functions doc_open, <functions to edit file>, doc_save, doc_close.
However as the script iterates over the files it doesn't appear to be making any modications as anticipated, and in the file explorer there is no updated "Date Modified" timestamp confirming that changes have not been made.
I get the correct count of xml files stored in the variable $filepaths. When I perform a "message" or "response" command it appears to be the correct $filepath but not certain as it doesn't seem to get modified. the replace function always returns saying "string not found" even though I am certain of the strings existence in the file.
My question is: Where am I going wrong in the logic for ACL Batch File Processing. Is it correct to think I should be able to grab all file paths and just perform a doc_open like i would on a single file modification? And is it possible to "open as text" instead of with the options "schema/dtd" or "free form mode"? I feel as "open as text" may provide the most freedom in programmability but I could be wrong.
Unfortunately I can not install powershell, notepad++, alternative programming languages or any other softwares thus the arbortext editor and its built in languages must suffice. If there is a suggestion to stay with ACL or also try perlscript in the Epic Editor im happy to hear suggestions for the best approach using epic editor for batch process string manipulation. Java unfortunately won't work because I won't be able to compile in the command prompt due to lack of a JDK install capability.
Thank You!
$filesDirectoryPath = "C:/Users/MyDirectory/Desktop/source_xml/"
$isDirectory = file_directory($filesDirectoryPath)
global filepaths[]
$XMLFilesPath = $filesDirectoryPath . "/" . "*.xml"
glob($XMLFilesPath, $filePaths)
$filePathsCount = count($filePaths)
for ($i = 1; $i < $filePathsCount; $i++) { #acl 1 based array reason for start index
$filePath = $filePaths[$i]
$documentID = doc_open($filepath, 0x80002)
replace($string1, $string2', 0x2002, "", $documentID)
doc_save($documentID)
doc_close($documentID)
}
# 0x80002 i believe will open the file for writing and in "free form mode", please correct me if im wrong. !!!I am also wondering if its possible to "open as text" but there does not seem to be that capability documented in "doc_open" help center!!!
#0x2002 I believe will replace all instances in the file and be case sensitive search.

