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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

customize field-separator in "si viewproject" and "si viewprojecthistory" CLI ?

mnein
2-Explorer

customize field-separator in "si viewproject" and "si viewprojecthistory" CLI ?

Hi,

I need to run the commands "si viewproject" and "si viewprojecthistory" to gather information about checkpoints, labels and members (associated to a specific checkpoint/version of a project) for reporting.

 

The documentation states for both commands: <<Under the CLI the fields are separated with a space.>>

 

This is only partly correct, since "viewprojecthistory" uses <tab> as separator while "viewproject" uses <space> (optional multiple depending on indent).

 

My question: Is there any (CLI-) option available to customize the column/field sparator for the output of these commands? The preferred separator character for me would be <tab>.

 

Integrity-Version (si about):

Integrity 11
Build: 11.0.0.506
API Version: 4.16.506
Hotfixes:
Copyright (c) 2016 PTC Inc. and/or Its Subsidiary Companies. All Rights Reserved.

 

thanx

Markus

ACCEPTED SOLUTION

Accepted Solutions
awalsh
17-Peridot
(To:mnein)

Using the --format option for si print, you can control exactly what you get, including field separators.

You also have to use -r:member to display only the member revision info, as I found that si print shows all revisions by default. 

For example:

si print --recurse -r:member --noHeaderFormat --noTrailerFormat --format="{projectname}\t{membername}\t{memberrev}\t{date}\t{cpid}\r\n"

Will display the project/subproject, member, member revision, date, and change package for each member on a separate line, with the fields separated by tabs.  Since there's no indent or subprojects displayed with si print, I added the projectname field so you know which subproject the members belong to.

The list of fields is found in the si rlog man page.

View solution in original post

3 REPLIES 3
kthierer
12-Amethyst
(To:mnein)

My alternative for si viewproject would be

c:\MySandbox>si print --recurse --revision=:member --fields=membername,memberrev,archivename

where the fields are separated by tabs (at least for my integrity version).

 

For more control about format you should read in the reference guide how to use

the --format option.

Note that "si print" is using "si rlog" internally.

(I guess: si rlog --NoHeaderFormat --NotrailerFormat --revision=:member --fields=membername,memberrev,archivename)

 

Regards Juergen

awalsh
17-Peridot
(To:mnein)

Using the --format option for si print, you can control exactly what you get, including field separators.

You also have to use -r:member to display only the member revision info, as I found that si print shows all revisions by default. 

For example:

si print --recurse -r:member --noHeaderFormat --noTrailerFormat --format="{projectname}\t{membername}\t{memberrev}\t{date}\t{cpid}\r\n"

Will display the project/subproject, member, member revision, date, and change package for each member on a separate line, with the fields separated by tabs.  Since there's no indent or subprojects displayed with si print, I added the projectname field so you know which subproject the members belong to.

The list of fields is found in the si rlog man page.

mnein
2-Explorer
(To:awalsh)

thanx to all,

now I get the report in a format I like it Smiley Happy

Announcements


Top Tags