Donna,

thank you very much for your answer.

Sadly what you suggest doesn't work - or maybe you misunderstood what I wanted to achieve :-)

field=Replace(field, field, "other-positions",   "positions")
field=Replace(field, field, "other-connections", "connections")
field=Replace(field, field, "other-data",        "data")
field=Remove(field, {"other-positions", "other-connections", "other-data")

is equivalent to

field=Rename(field, "other-positions",   "positions")
field=Rename(field, "other-connections", "connections")
field=Rename(field, "other-data",        "data")

In both cases the problem remains that the attributes are preserved.
So the new 'connections' component has an attribute 'ref' with the
value 'other-positions' and not 'positions'. The new 'data' component
has an attribute 'dep' with the value 'other-positions' which should
now be 'positions'.

In order to fix this, I have to

data=Extract(field,"data")
data=Options(data,"dep","positions")
field=Replace(field,data,"data","data")

and the same for the connection component.

So again, is there a shorter/easier way to achieve the overall result?

Torsten

Donna L Gresh wrote:

You might try Replace instead of Rename. I think the syntax is
Replace(your-6-field, your-6-field, "positions", "other-positions"); //or maybe the last two switched

this should preserve the attributes (I think :)



Donna L. Gresh, Ph.D.
Optimization and Mathematical Software Group
IBM T.J. Watson Research Center
(914) 945-2472
http://www.research.ibm.com/people/g/donnagresh
[EMAIL PROTECTED]



        *Torsten Hofmann <[EMAIL PROTECTED]>*
Sent by: [EMAIL PROTECTED]

12/16/2003 10:48 AM
Please respond to opendx-users

To: [email protected] cc: Subject: [opendx-users] Splitting a field in two




Hi,

I have a field with 6 components:
-positions
-connections
-data
-other_positions
-other_connections
-other_data

where the first and last three components each belong together. I'd
like to visualize the two datasets separately, basically splitting
this into two fields with 3 components each.

What I do at the moment to visualise the 'other_' dataset is: Rename
other_positions to positions, other_connections to connections and
other_data to data. The problem is that afterwards I still have to fix
the attributes 'ref' of connections and 'dep' of data to point to the
correct component and not to the 'other_' component. This takes each
an Extract, Options, Replace cycle.

This works but looks and feels a bit convoluted to me. Is there an
easier way?

Thanks a lot for your help.

Torsten

--
Dipl. Rech. Wiss. ETH Torsten Hofmann
Lehrstuhl Werkstoffkunde und Technologie der Metalle (WTM)
Universität Erlangen-Nürnberg
Martensstr. 5
91058 Erlangen

Phone : +49 9131 / 85 287 26
Fax   : +49 9131 / 85 275 15
Email : [EMAIL PROTECTED]

Reply via email to