Subscribe Bookmark RSS Feed

IMPORT EXCEL FILES VIA JSL - COLUMN FORMAT

angela_manginel

Community Member

Joined:

Feb 18, 2016

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 REPLY
pmroz

Super User

Joined:

Jun 23, 2011

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);

);