Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Search and Copy text to another attribute
Topic Summary:
Created On: 2-Nov-2006 19:57
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 2-Nov-2006 19:57
User is offline View Users Profile Print this message


John Aguilar

Posts: 1
Joined: 19-Sep-2006

I know this is probably easy for most but I'm very new to DXL scripting and I would like to know if anyone out there can point me in the right direction for this type of script. I need it to search for a specific string of text and copy it to a new column/attribute. My thanks in advance.
Report this to a Moderator Report this to a Moderator
 2-Nov-2006 23:26
User is offline View Users Profile Print this message


Scott Covington

Posts: 17
Joined: 29-Nov-2004

Real quick and somewhat off the cuff, a code snippet follows.
It may not be perfect, but it should point you in a reasonable direction.
There are tons of permutations you could do.  I picked one.
Regular Expressions may be your friend for this one if you haven't used them yet.

Good luck


string objtext
Object o
Module m = current

// loop through all object in this module
for o in m do
{
  objtext=o."Object Text"
  // if Object Text contains xyz
  if (matches("xyz", objtext))
  {
    // copy everything after xyz to the other object
    o."other object" = objtext[end 0 + 1:]
  }
}
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.