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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

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

JensN.
14-Alexandrite

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

 

ACCEPTED SOLUTION

Accepted Solutions

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

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

 

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
JensN.
14-Alexandrite
(To:KaelLizak)

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

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
BaluSri
10-Marble
(To:JensN.)

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

 

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

 

Thank you,

 

Balu

Announcements


Top Tags