Whenever I open my data table using JSL, the first row (except for the first cell) is deleted and replaced with dots. I was just wondering why as when I open it manually it seems to work fine. Any suggestions would be appreciated.
You really need to provide the data table, and the script you are using.......there are just so many items that can be in the data table, it is impossible to even guess at what is going on.
So, the above is an example of the excel file which I open in JMP using JSL. When I open it using my script, it turns the second row (all cells after date) to dots. I think it may be to do with how it's imported. Do I need to specify how to open the table in my script, e.g. using best guess etc.? Also, in my script I specified that the data starts on row 2, I'm thinking that might have something to do with it? As a sidenote, this isn't the excel file I originally tested on, but an example of it. The columns would otherwise be filled with data.
Your data starts on row 3, not row 2. So you need to change that, and your data should read in correctly.
I thought that that may be the issue but it doesn't work. In jmp, when the excel file is converted into a data table, the first row is used as a column heading...
I think I know now what was going wrong. At the end of my script I set the columns to numeric and nominal, which is why the character values probably get replaced (I'm still not sure why the Date wasn't replaced though.) Is there a way to specify the data type of a row in JSL?
Your data does start on row 3. That is clearly indicated in the data table image you show. The column name "Date" has been read in from row 1 of your csv file, and then your data is being read in starting on row 2. The value on row 2 of your csv file has the value of "Date". Therefore JMP is finding a non numeric value and it then sets the column to be a Character data type. What you need to do, is to use the data previewer when opening the file, and go through the wizard and select the start of the data being on line 3. You can also specify the data to be forced to be numeric or character. To go to the Preview, when you select the file, you will see that in the lower left of the window, there is a list of checks that you can do, select the "Data with Preview".
If you do this once, and then edit the "Source" entry in the data table, you will see the JSL you can use to read in the data table from a script.
If you still need to change the data type in JSL, the code is
:date << data type(numeric);
This is documented in either the Scripting Guide
or in the Scripting Index
Okay, that's fine thanks. My data table appears fine when I use JSL to mainpulate the import. After I import the table however, I change the columns to numeric and continuous so in te end result, the row is missing again. That's why I asked for a way to set he data type of a row (so that I could set it to character and the row would appear again.