cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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);

);

Recommended Articles