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

Batch processing to save Sgml files as Xml

benk78
4-Participant

Batch processing to save Sgml files as Xml

Hello,

I have a lot of sgml files in a directory.

I would like to convert them with arbortext editor (to keep change tracking PI) without open them one by one...

Is there a way ?

I found some topics here but nothing really helpfull.

Thanks for your help.

Benjamin

4 REPLIES 4
GarethOakes
14-Alexandrite
(To:benk78)

I haven't done this sort of thing for a while now but it is definitely possible. You can write a very simple ACL script to achieve this. You should review the help documentation, I think the commands you would need are "glob", "edit" and "save". ACL scripts are very similar to Perl, if you have any experience with Perl scripts you should easily handle this task. If you haven't already done so, turn on the "command line" from the Editor Preferences dialog so you can enter script commands directly.

benk78
4-Participant
(To:GarethOakes)

Hello,

I have no experience in perl but I will take a look to your commands.

Thx.

Benjamin

benk78
4-Participant
(To:benk78)

I took a look at the documentation and tried glob:

glob('c:\*.sgm', files)

in my command line but it is only answering :

Argument n°2 for glob() must be a table's name

not very efficient, i'm affraid...

Any idea ?

GarethOakes
14-Alexandrite
(To:benk78)

Have a look at the packages\*.acl files in the program folder to get an idea of ACL syntax. I haven't got time to work this out but something like this should get you on the right track:

function findFiles() {
  local myFiles[];
  glob("C:\Apps\PTC\Arbortext Editor\packages\*.acl", myFiles);
  response(myFiles[0]);
}
findFiles();

You can run this from the Arbortext command line for testing but really you should put the functions in an init .acl file or something like that.

Announcements