cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
lwx228
Level VIII

How to use JSL to make TXT files of decimal data into binary format files?

Decimal files use recent tabs to divide data into three columns.
They are all integers:
The data in the first column ranges from 90,000 to 199,999
Column 2: positive integers from 100 to 900,000
Third column: positive and negative integers or 0

2021-09-27_1828.png

They have a lot of rows.
There is no limit to how to save them as binary files or file suffixes using JSL.
And   need to figure out how to re-read restored decimal data from this new binary into JMP.
Thank you very much!

14 REPLIES 14
lwx228
Level VIII

Re: How to use JSL to make TXT files of decimal data into binary format files?

I still find this code.

2021-09-30_0719.png

 

I tried to write several did not work

 

Column(dt,1)<<Data Type(numeric(4))<<Set Modeling Type(Continuous);


Column(dt,1)<<Data Type(4)<<Set Modeling Type(Continuous);

 

 Thanks!

Craige_Hales
Super User

Re: How to use JSL to make TXT files of decimal data into binary format files?

lwx228
Level VIII

Re: How to use JSL to make TXT files of decimal data into binary format files?

I see. I usually use JMP14 or 15.Because it's still Windows 7.

 

I tried another computer last night using JMP 16.I just saw it. "16.0.0"

2021-09-30_1012.png

 

 

Thanks for Craige's unreserved patient help.

Craige_Hales
Super User

Re: How to use JSL to make TXT files of decimal data into binary format files?

The short numeric columns have been in JMP for a long time. Probably back to JMP 5, maybe longer. The preference menu has changed over time, but I think the script will work fine in old versions of JMP.

Craige
lwx228
Level VIII

Re: How to use JSL to make TXT files of decimal data into binary format files?

OK

 

dt=Open("/C:/1/ss.txt",columns(
New Column("c000001",Numeric(4),"Continuous",Format("Best",12)),
New Column("c000002",Numeric(4),"Continuous",Format("Best",12)),
New Column("c000003",Numeric(4),"Continuous",Format("Best",12))),
Import Settings(End Of Line(CRLF,CR,LF),End Of Field(Tab,CSV(0)),Strip Quotes(1),
Use Apostrophe as Quotation Mark(0),Use Regional Settings(0),Scan Whole File(1),
Treat empty columns as numeric(0),CompressNumericColumns(0),CompressCharacterColumns(0),
CompressAllowListCheck(0),Labels(0),Column Names Start(1),Data Starts(1),Lines To Read("All"),
Year Rule("20xx")));

 

Thanks!