SDL Trados Studio
SDL Trados GroupShare
SDL Trados Business Manager
SDL Trados Live
SDL Speech to Text
SDL Managed Translation - Enterprise
Translation Management Connectors
SDL LiveContent S1000D
SDL Contenta S1000D
SDL Tridion Docs
SDL Tridion Sites
SDL Content Assistant
SDL Machine Translation Cloud
SDL Machine Translation Connectors
SDL Machine Translation Edge
Tridion Docs Developers
SDL User Experience
Language Products - GCS Internal Community
SDL Community Internal Group
SDL Access Customer Portal
SDL Professional Services
SDL Training & Certification
Language Technology Partner Group
SDL Academic Partners
SDL Enterprise Technology Partners
ETUG (European Trados User Group) Public Information
Machine Translation User Group
Nordic SDL Tridion Docs User Group
SDL Tridion UK Meetup
SDL Tridion User Group New England
SDL Tridion West Coast User Group
SDL WorldServer User Group
Tridion Docs Europe & APAC User Group
Tridion User Group Benelux
Tridion User Group Ohio Valley
SDL MultiTerm Ideas
SDL Passolo Ideas
SDL Trados GroupShare Ideas
SDL Trados Studio Ideas
SDL Machine Translation Cloud Ideas
SDL Machine Translation Edge Ideas
SDL Language Cloud TMS Ideas
SDL Language Cloud Terminology Ideas
SDL Language Cloud Online Editor Ideas
SDL Managed Translation - Enterprise Ideas
SDL TMS Ideas
SDL WorldServer Ideas
SDL Tridion Docs Ideas
SDL Tridion Sites Ideas
SDL LiveContent S1000D Ideas
SDL Contenta S1000D
SDL XPP Ideas
Events & Webinars
To SDL Documentation
To SDL Support
What's New in SDL
We often output many divisions of a job to a single Xyascii text file, and process that text file with Perl. In some cases we need the division name in that text file when the output changes to that division. I've looked through the help screen for fromxsf with no results. On our old Linux XPP I had this output at the top of each division in the text file:
(Xyascii stuff, of one or more pages)
(many Xyascii pages of products)
I did this using a shell script and an array of division names to output and concat to a single text file. But now on Windows Server 2012 I cannot get arrays to work in a batch file. If anyone can get the division name output to a text file with multiple divisions, I would be very grateful.
The reason for the division name is we need to process some divisions differently and we don't have another way to do ID different divisions. We cannot rely on operators entering special codes for this by hand.
Here we go, you have to escape a % with another % sign in a .bat file. Here's what worked:
-hdr "Name %%d"
at the very end of the command line. Here's the whole command .bat file:
Chuck, If you have been able to write a shell script to make the magic happen, you should be able to write a perl program that does the same for you. (I find writing shell scripts a lot harder than writing perl programs). Shameless conference plug: I will do a hands on mini-clinic on writing XPP tools during the upcoming XyUser conference. It will come with a toolkit (=some perl modules) that will give you a framework for writing job, division or any other xpp tool. I might even use this question as an example that we built during the mini-clinic...
Our current cmd.exe batch file to export a group of divisions is this: set outfile=output.txt fromxsf %outfile% +m -nbs -dos -Rep -nofrills -xyp 4 -job -div DIV_05-wall,DIV_06-base,DIV_07-tall,DIV_08-office,DIV_09-vanity,DIV_10b-filler_spread -cat
would the fromxsf option of
give you what you need?
It seems to from the wording in the XPP manual - Transforming Data XPP … see example at the top of page 2-7
That just seems to put a "D" at the top of the output Xyascii file. It doesn't do what I would like.
Here's the command line I'm using: fromxsf %outfile% +m -nbs -dos -Rep -nofrills -xyp 4 -job -HDR %D -div DIV_one,DIV_two -cat
I tried many variations of that switch like:
None of them worked.
You can only use the %d thing in combination with the lowercase -hdr option.I tried a -hdr "Prestring: %d" on my system in combination with a -all instead of the -div option and it worked.
Sounds like the '%' is being dropped. Is your script a .bat file? If so, then the %D is being seen as a windows batch file argument I suspect. I agree with Bart, Perl is better for scripting as it has many more features and less 'weirdness'. IMHO
I have to use the -div option. I don't have a choice in this. Some divisions are backup divisions or intro matter and I don't want those in the resulting Xyascii file.
Yes, I think you nailed it. It is the .bat file that creates the problem.
So try with:fromxsf %outfile% +m -hdr "%%d" -nbs -dos -Rep -nofrills -xyp 4 -job -div DIV_05-wall,DIV_06-base,DIV_07-tall,DIV_08-office,DIV_09-vanity,DIV_10b-filler_spread -cat
Yes it's a windows .bat file in cmd.exe.