Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hello,
I have a problem with exported files from mathcad. I have a table and I'm using WRITEPRN. It´s works perfectly but whem I try to open the file in Kaleidagraph, i can´t open the columns correctly. Attached is the example.
Can anyone help me?
Solved! Go to Solution.
My best guess without seeing your sheet is that you data table in Mathcad contains not scalar data only but one entry maybe is a matrix itself - nested matrix.
If thats true, WRITECSV even with the correct order of the arguments (see: https://community.ptc.com/t5/PTC-Mathcad/Exporting-table-from-Mathcad/m-p/685090/highlight/true#M191612) will fail with "Not supported type" error.
If possible you may consider posting your worksheet for inspection.
EDIT: Next (probably better) guess. You don't have a nested matrix, but if I interpret the header correctly, your data table contains non-real numbers with very tiny imaginary parts. This accounts for the extra numbers you see in the created file which are separated by the real part by a comma.
So try T:=WRITEPRN(arquivo, Re(forca))
This should give you a text file without any header and without the extra numbers and maybe Kaleidograph is happy with that file.
Otherwise you may try T:=WRITECSV(Re(forca), arquivo) or even WRITEEXCEL.
Using WRITEPRN you may also have a look at the system variables PRNPRECISION and PRNCOLWIDTH to have a bit more control over the outcome.
Which data format does "Kaleidagraph" expect?
WRITEPRN creates a somewhat proprietary file format, maybe WRITECSV would be a better alternative.
BTW, its always better to attach the Mathcad file itself and not just pictures.
Hi,
Kaleidaghaph supports many types o files, including .txt. I believe that my problem is in the first row where appears:
// Datafile written by Mathcad
// 08/31/20 10:57:09
.MATRIX 0 1 24 7.
I tried any ways to open it but i couldn't do it.
I tried to use the WRITECSV function to the same matrix, but occurs an error that say "this value must be a string". I don´t understand this because to me, it is a matrix
The "concatenate" command is expecting to put two or more strings together, but you don't need it:
Look at the integrated Mathcad help!
The arguments have to be switched --> WRITECSV(forca, arquivo)
In Prime as seen in Freds screenshot it has to be the other way round
This is a discrepancy in syntax in Mathcad 15. All WRITExxxx commands will expect the path+filename as their first argument, but WRITECSV and WRITEEXCEL (another option you might try) have it differently. Even though its documented in the help its sure not as it should be. In Prime this was fixed and the filename is the first argument of ALL WRITExxxx commands with no exception.
I have a table and I'm using WRITEPRN. It´s works perfectly but whem I try to open the file in Kaleidagraph, i can´t open the columns correctly.
I think your trouble is in Kaleidagraph. (I don't have version 15, so I can't recreate your table, but when I WRITEPRN a matrix,
I can open it in Notepad:
or Word:
or EXCEL and get exactly the same thing.
Looking at your two pictures
It looks like there are numbers being created that weren't originally there.
Try opening your prn file with notepad, what do you see?
Truly strange!
In Mathcad 15, you can (by right-clicking on the table) select the entire table and copy it. Can you simply paste that data into Kaliedagraph?
My best guess without seeing your sheet is that you data table in Mathcad contains not scalar data only but one entry maybe is a matrix itself - nested matrix.
If thats true, WRITECSV even with the correct order of the arguments (see: https://community.ptc.com/t5/PTC-Mathcad/Exporting-table-from-Mathcad/m-p/685090/highlight/true#M191612) will fail with "Not supported type" error.
If possible you may consider posting your worksheet for inspection.
EDIT: Next (probably better) guess. You don't have a nested matrix, but if I interpret the header correctly, your data table contains non-real numbers with very tiny imaginary parts. This accounts for the extra numbers you see in the created file which are separated by the real part by a comma.
So try T:=WRITEPRN(arquivo, Re(forca))
This should give you a text file without any header and without the extra numbers and maybe Kaleidograph is happy with that file.
Otherwise you may try T:=WRITECSV(Re(forca), arquivo) or even WRITEEXCEL.
Using WRITEPRN you may also have a look at the system variables PRNPRECISION and PRNCOLWIDTH to have a bit more control over the outcome.
Hi,
Your tip with writeprn(....)works. Thank you very much.
I solved the problem clicking with the right button on the matrix and exporting as txt.
Your tip is better because it´s faster.