cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Create Jmp file by c#

Hi,
I need to save a JMP file using C#. I checked in the samples folder attached to the software and there is no sign of saving a file.
It should be something simple but I couldn't find an answer online either.
Does anyone have an idea?
Thanks.

5 REPLIES 5
Craige_Hales
Super User

Re: Create Jmp file by c#

You mean output a data table from C# so JMP can read it? Here are some ideas:

 

  • Use CSV. This is the easiest, and highly recommended.
  • Use JSON.
  • Use automation to run JMP from C#. This is complicated, but the only way to make a proper .jmp file. Requires JMP and Windows, not Mac. May be slower than you expect.
  • Save a JMP data table as a script, study the script, and write C# code to make a similar script. This will give you a .jsl file that will open as a data table.

The .jmp file is a binary file. Most of the other files JMP saves are text, and can be opened with an editor. JMP does not document how to create the binary file, and may not support editing/changing some of the text files.

 

How much data are you looking at? Pure numeric? There are some optimizations using blobs if you are sending >10 million or so numbers.

 

Craige

Re: Create Jmp file by c#

Thanks Craige_Hales.
The reason I am trying to create a jmp file is that when I load data from sql server to jmp, the tables that are opened cannot be worked on until you save to a jmp file and only then can you work on the information. I thought to solve it by saving the data to a jmp file and then opening it for work. Maybe you have another idea how to solve the problem?
Craige_Hales
Super User

Re: Create Jmp file by c#

It might be fastest to let JMP open the SQL data directly into a data table. If the C# code isn't adding anything to the data, it will probably be pretty easy to do the SQL statements from JSL.

query builder 

Craige

Re: Create Jmp file by c#

I'm trying to give the user easy access so they don't have to write queries

like you said i fill DataTable

Maybe I'm doing something wrong?

 

JMP.DataTable dt = null;
JMP.AUTODB db = rndJMP.NewDatabaseObject();

db.Connect(connactionString);
dt = db.ExecuteSQLSelect(Query);

 

 missing a command that would allow editing later in JMP?

Craige_Hales
Super User

Re: Create Jmp file by c#

I am not a C# or SQL or automation expert. Without seeing code and log messages I can't make good guesses.

Print some intermediate results, add some comments to help me understand what's happening.

You should make a working query in JMP first, then make that logic work from C#.

From your question, I think it might be possible you just need to make the C# automation tell JMP to save the table to disk.

 

Craige