cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Choose Language Hide Translation Bar

IMPORT EXCEL FILES VIA JSL - COLUMN FORMAT

Hi all i am using JSL of JMP 11.

I want to import and excel file.

Is there a way to force JMP/JSL to import ALL COLUMNS as TEXT (CHARACTER) ?

My columns have empty cells and text and number. The script I wrote in JSL automatically read them as number, therefore putting missing values in my text cells.

I want to import them as text.

here the piece of code.

dt = Open("mydata.xlsx",

Worksheets( {"Sheet1"} ),

Use for all sheets( 1 ),

Concatenate Worksheets( 1 ),

Create Concatenation Column( 1 ),

Worksheet Settings(

1,

Has Column Headers( 1 ),

Number of Rows in Headers( 3 ),

Headers Start on Row( 1 ),

Data Starts on Row( 4 ),

Data Starts on Column( 1 ),

Data Ends on Row( 0 ),

Data Ends on Column( 0 ),

Replicated Spanned Rows( 1 ),

Suppress Hidden Rows( 1 ),

Suppress Hidden Columns( 1 ),

Treat as Hierarchy( 0 )

)

);

Thank you.

Angela.

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: IMPORT EXCEL FILES VIA JSL - COLUMN FORMAT

Not sure how to do it directly, but you could add a post-processing step:

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

col_list = dt << get column names(Numeric, "String");

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

      column(dt, col_list[i]) << data type(character);

);

View solution in original post

1 REPLY 1
pmroz
Super User

Re: IMPORT EXCEL FILES VIA JSL - COLUMN FORMAT

Not sure how to do it directly, but you could add a post-processing step:

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

col_list = dt << get column names(Numeric, "String");

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

      column(dt, col_list[i]) << data type(character);

);