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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to replace strings in a table with the value of strings from another table? (see attach)

Bartz87
1-Newbie

How to replace strings in a table with the value of strings from another table? (see attach)

How to replace strings in a table with the value of strings from another table? Then get the sum of the product of the 1st & 2nd col, 3rd & 4th col...etc. (or col1xcol2 + col2+col3 + col4xcol5...etc)

8 REPLIES 8
StuartBruff
23-Emerald II
(To:Bartz87)

Neptali Barte wrote:

How to replace strings in a table with the value of strings from another table? Then get the sum of the product of the 1st & 2nd col, 3rd & 4th col...etc. (or col1xcol2 + col2+col3 + col4xcol5...etc)

Sorry, don't have time to make it more elegant ... just dashing out to work ...

Stuart

Stuart_Bruff wrote:

Neptali Barte wrote:

How to replace strings in a table with the value of strings from another table? Then get the sum of the product of the 1st & 2nd col, 3rd & 4th col...etc. (or col1xcol2 + col2+col3 + col4xcol5...etc)

Sorry, don't have time to make it more elegant ... just dashing out to work ...

That's odd ... I can't see the worksheet I posted. Just in case, I've whipped up another one ...

Stuart

Message was edited by: Stuart_Bruff Forgot to add, I've only got M13 at work so can't open your original worksheet ... hence making some data up and hoping I remembered the nature of the problem!!!!!

Stuart_Bruff wrote:

...Forgot to add, I've only got M13 at work so can't open your original worksheet ..

Stuart,

I converted this file for Mathcad 13 version (please see the attachment).

StuartBruff
23-Emerald II
(To:VladimirN)

VladimirN. wrote:

Stuart_Bruff wrote:

...Forgot to add, I've only got M13 at work so can't open your original worksheet ..

Stuart,

I converted this file for Mathcad 13 version (please see the attachment).

Спасибо, Владимир. 🙂

By some amazing stroke of luck, my worksheet is pretty close to the original, only seemingly differing in the trivial matter of the 'B' (test2) matrix values! I substituted test2 for B in my sheet and it gives the expected value. ... if only I were so lucky with lottery numbers 😞

Stuart

Mr. Stuart,

That worksheet was really helpful. Thanks! I'm actually learning how to read it, unfortunately, I still can't (hehe). I'm still learning how to program. I made some modifications on the input. I want to replace the values of strings in "B" and maintain the zeroes. I have attache a file here.

StuartBruff
23-Emerald II
(To:Bartz87)

Neptali Barte wrote:

Mr. Stuart,

That worksheet was really helpful. Thanks! I'm actually learning how to read it, unfortunately, I still can't (hehe). I'm still learning how to program. I made some modifications on the input. I want to replace the values of strings in "B" and maintain the zeroes. I have attache a file here.

You mean like the attached? I'm afraid you've caught me munching my morning porridge (and being late), so I've left the column order as in my original worksheet ... some playing around with indices should fix that and is good for one's spiritual development. 🙂

Stuart

StuartBruff
23-Emerald II
(To:Bartz87)

Having had a few spare moments, I generalized your problem by creating a function that should handle different sized arrays and also deal with numeric 'labels' not just alphabetic ones. There are a few functions in the attached worksheet that might prove useful for generating test arrays. I've only had time to give it a cursory check, so there are bound to be a few bugs ... if anybody finds any, please let me know and I'll try to fix them.

It also handles the 0 entries for a label (in fact, it should handle any case where the label isn't found).

Stuart

I have find your expected results from simple steps, please find the results in attachment mathcad file highlighted regions.

Top Tags