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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Translate the entire conversation x

Sort through a text file.

Snowshoeman
12-Amethyst

Sort through a text file.

I have a set of commands that sort through a text file to get values, make some of those values a number and then name those values.  (See Attached).  When I calculate the sheet, I can literally see Prime paint the values into my sheet.  Is there a faster way?

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Snowshoeman)

But the includes would only be done once. After that extracting the values via the GetValue5S1 function should be quite fast without you literally seeing how Prime paints the values.

It might speed up (but only a very little bit) if you do the conversion from string to numbers only once for all the data and not in the GetValue function.

Werner_E_1-1754582684064.png

 

I don't think that I can say any more about your experiencing such a slow performance without actually seeing the sheet(s).

 

View solution in original post

10 REPLIES 10
Werner_E
25-Diamond I
(To:Snowshoeman)

Whats the dimensions of matrix ID5_S1, how many rows?

Shouldn't be so slow normally.

It is 270 rows long.  It might be slow because the file does an INCLUDE statement 4 times before it does the text file processing.

Werner_E
25-Diamond I
(To:Snowshoeman)

But the includes would only be done once. After that extracting the values via the GetValue5S1 function should be quite fast without you literally seeing how Prime paints the values.

It might speed up (but only a very little bit) if you do the conversion from string to numbers only once for all the data and not in the GetValue function.

Werner_E_1-1754582684064.png

 

I don't think that I can say any more about your experiencing such a slow performance without actually seeing the sheet(s).

 

These are great suggestions!  Thanks!

As near as I can tell,, the arrows are symbolic operation operators.  Why are they required in the above?

 

Werner_E
25-Diamond I
(To:Snowshoeman)

No, these arrows don't indicate a symbolic operation but rather 'vectorization'.

Werner_E_0-1754934102528.png

 

See: Vectorize Operator

Now that I know what it is and watched a video, I understand.  Thanks!

Hi Bob,

Use the WRITEPRN() and READPRN() functions as they can handle both strings and values in a matrix.

This will simply the GetValue() function and it will be faster. 

 

// Datafile written by Mathcad
// 08/07/25 13:46:36

.MATRIX 0 0 4 2
"ZiANG" 83.9 "Z0MAG" 4.78 "Z0ANG" 81.5 "LOCAT" "Y"

 

Cheers

Terry

And even faster.

I'm not sure this will work as all the data I get from the text files are strings.  I have to turn a lot of the string data into numbers for future processing.

Announcements

Top Tags