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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

import data with dat file and string

태장
1-Newbie

import data with dat file and string

Hi

I am trying to import the data which has both the string and numbers from testing result in mathcad prime 3.0 version but in mathcad 15 version, I can sort the data with rows and columns as enclosed file but no idea to sort the columns as 15version did. someone help me? thanks in advance!

5 REPLIES 5
Werner_E
24-Ruby V
(To:태장)

The file you try to read is NOT comma separated which means that the values are not separated by a "," sign.

You can tell Prime that it should use another separator (which seems to be simply a space here ore better: we have fixed widths) and also to replace empty values not by NaN's but by a zero (which seems to be the case in the picture of Mathcad 15 you provided).

Unfortunately the Prime help, as so often, is not of any help here, so we have to resort to Mathcad 15 help

If we apply this information to your data we get

which seems to be close to what your Mathcad 15 pic is showing.

When I use the same command in Mathcad 15 I get this result

As you can see MC15s result is different but still not correct either.

You may consider reading the file beginning with line 8 (the actual data) and reading in the parameters of the first few lines in an extra step.

You may also consider playing around with READFILE (not sure about that) or READBIN,

Or you are able to preprocess the data file making it better suited for Primes Read commands.

Only when If I look at your data file using a simple editor I see what the data actually should be:

Werner_E
24-Ruby V
(To:태장)

Here is a way to get the actual data beginning from row 8 in a neat way

There are 8 values per row and the data seems to be formatted taking up 5 columns (the first one only 4) per value (including preceding spaces). Therefore the 8 x 1 vector consisting of mostly 5's.

WE

Werner_E
24-Ruby V
(To:태장)

OK, here is the rest:

WE

Dear Werner Exinger

Thank you very much for your help! It is helpful for me to advance to next step and I informed to PTC about this trouble in mathcad prime.

Have a nice day!

with best regard,

T.K,Jang

Werner_E
24-Ruby V
(To:태장)

While its interesting an a bit irritating that Mathcad and Prime give different results when using READCSV, both have to fail.

But don't blame Mathcad and even not Prime - the Problem is not Mathcad or Prime but simply the fact, that the data file is not a CSV (comma separated values) file.

Nevertheless, after finding out what the file format is, I showed you how to correctly read in the parameters and data - both in Mathcad and Prime.

So there is nothing wrong here an nothing buggy.

Top Tags