cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

command line

douglaswade1
1-Newbie

command line

Ok, I am too lazy to find it my email mess. I want to do a perl (or bat)
script firing off Arbortext from a command line with Arbortext opening a
file, running a set command, validate, save it out and the perl script
continues doing more magic.

#--- Sets the length of the file width before a line break
set outputrecordlength=10000


I went looking thru 10 years of emails and cannot find it. But, I know Clay
or Liz (plus dozen others could answer it in their sleep).

d
2 REPLIES 2

Hi Doug--

I'm not sure about the "in my sleep" part--though some days I feel like I'm doing all my programming in my sleep... 😉

Anyway, about your question, you can use the -c switch when starting Arbortext to execute a command, e.g.

C:\Program Files\PTC\Arbortext Editor\bin\x64\editor.exe -c "print composed" foo.xml

So, you can combine this with Windows command syntax (a batch file) to iterate over a set of files, something like this:

:REM print all files in directory
for %%i in (*.xml) do (
echo "C:\Program Files\PTC\Arbortext Editor\bin\x64\editor.exe" -c "print composed" %%i
)

If you want to do something at all complicated inside Arbortext, I'd recommend defining a function to accomplish it, and then calling the function in this way. The idea is to make the code you pass to the -c parameter on the command line as simple as possible.

--Clay

Except take the "echo" out of the command inside the loop. (I didn't actually want to print all my XML files when testing the script...)
Top Tags