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

How to add multiline description to an admin object via CLI?

SOLVED
Highlighted
Aquamarine

How to add multiline description to an admin object via CLI?

Hi all,

 

we're using a lot of fields in our integrity items, and very often the fieldnames are not the same as the display names. To help our users to indentify which name they should use (maybo for queries or so) we want to put the fieldname into the description of the field itself, so the user could look at the tooltip of any field to get the real fieldname.

So we tried to add the fieldname to the mostly existing description, and we dont want to do this with the admin client, because this would be a horrible clickwork (for more than thousand fields).

 

We've written a script and within this script we're using the CLI-commands to read the fields, then we parse out the description (which is also a pain) and we tried to use the CLI-commands also to write the new description. But how can you put a multiline description via CLI into the system?

 

An example: This is a description how it exists today, and how it was edited via the admin client:

 

This is a description
with at least three lines
last line

The new description should look like this:

Systemname: Testfield
This is a description
with at least three lines
last line

But i dont know how to put this text with the line breaks into the commandline for "im editfield" as a value for "--description="? I tried several kinds of escaping with "\n" or "chr(13)" or ASCII-Code etc. Always with one of two possible results: Either I got an error when executing the command, because the command line didn't appear to be complete anymore (because it ends at the first line break), or I get a single line with the complete text (maybe together with non-escaped escape-sequences) as description.

Any idea?

 

Thanks in advance,

 

Jens

 

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to add multiline description to an admin object via CLI?

Hallo Jens,

hm, looks like the usual carriage returns don't work here. 

I would propose to implement this Task with Java. Pretty sure that it works then.

Hope this helps

Volker

 

View solution in original post

5 REPLIES 5

Re: How to add multiline description to an admin object via CLI?

Hallo Jens,

hm, looks like the usual carriage returns don't work here. 

I would propose to implement this Task with Java. Pretty sure that it works then.

Hope this helps

Volker

 

View solution in original post

Re: How to add multiline description to an admin object via CLI?

Hello @JensN.,

 

I have to concur with @VolkerEckardt. You'll have to do it through Java.

 

Kind Regards,

-Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

Re: How to add multiline description to an admin object via CLI?

Hi @VolkerEckardt, hi @KaelLizak,

 

thank you for your answer. Frankly, I was expecting an answer like yours, but i didn't want to shoot sparrows with cannons. But it seems that i have to 😉

 

kind regards, Jens

Re: How to add multiline description to an admin object via CLI?

Hi Jens,

 

Sorry you have to resort to that cannon.  I tried all of the easy stuff I could think of, even backticking with Linux shell, and none of it worked.

 

-Kael


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager

Re: How to add multiline description to an admin object via CLI?

https://community.ptc.com/t5/Integrity/How-to-add-multi-line-quot-Work-Description-quot-using-CLI/m-...

 

Please use the solution I provided in the above discussion topic. 

 

Thank you,

 

Balu