BookmarkSubscribe
Choose Language Hide Translation Bar
josealvarez2685
Community Trekker

It is possible, save a file JMP as .ascii???

It is possible, save a file JMP as .ascii??

0 Kudos
6 REPLIES 6
Craige_Hales
Staff (Retired)

Re: It is possible, save a file JMP as .ascii???

JMP data tables can be exported as CSV for use with other programs.  Meta data, like column formats and table scripts, is not preserved.

JMP data tables can also create a script (red triangle menu) that will recreate the table with the meta data.

Both of these are plain text formats.  If your table data has non-ASCII strings, the files will contain those strings.

Craige
pmroz
Super User

Re: It is possible, save a file JMP as .ascii???

Not sure if this is what you're asking, but you can save a text string to an ascii file.  For example:

my_ascii_file = "c:\temp\test.ascii";

random_string =

"The quick red fox jumped over the brown log.

The quick red fox jumped over the brown log.

The quick red fox jumped over the brown log.

The quick red fox jumped over the brown log.

The quick red fox jumped over the brown log.";

save text file(my_ascii_file, random_string);

josealvarez2685
Community Trekker

Re: It is possible, save a file JMP as .ascii???

What I have is basically a table in JMP and I want to convert each column in a .ASCII file...???

0 Kudos
pmroz
Super User

Re: It is possible, save a file JMP as .ascii???

Try something like this:

dt = open("$sample_data\Big Class.jmp");

for (i = 1, i <= ncols(dt), i++,

    one_col  = column(dt, i);

    one_name = one_col << get name;

    one_type = one_col << get data type;

    col_list = as list(one_col << get values);

    if (one_type == "Numeric",

// For numeric columns convert number to character

        for (k = 1, k < nitems(col_list), k++,

            col_list[k] = char(col_list[k]);

        );

    );

// concatenate all column values together with a line feed between each one

    col_text = concat items(col_list, "

");

    one_file = "c:\temp\" || one_name || ".txt";

    save text file(one_file, col_text);

);

0 Kudos
Highlighted
josealvarez2685
Community Trekker

Re: It is possible, save a file JMP as .ascii???

Thank you so much

thank you very much for the help

Now I have a folder with 500 files in txt format and want to import them JMP table, each txt file must correspond to a column in JMP. and each column must be added the name of the txt file.

appreciate your help

0 Kudos
Craige_Hales
Staff (Retired)

Re: It is possible, save a file JMP as .ascii???

or if you want all the columns in one file, export to CSV via JSL like this (or use File->Save):

dt = open("$sample_data\Big Class.jmp");

dt<<save("$temp/test3.csv");

loadtextfile("$temp/test3.csv");

"name,age,sex,height,weight

KATIE,12,F,59,95

LOUISE,12,F,61,123

JANE,12,F,55,74

JACLYN,12,F,66,145

LILLIE,12,F,52,64

...

Craige
0 Kudos