Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
lala
Level III

How do I convert this file to table form using JSL?

  • Column names can be used with other names.Thanks!

  • 2020-03-05_14-51.png

var hq_str_CON_OP_10002283="6,0.5050,0.5050,0.5055,1,1805,14.96,2.5000,0.4393,0.4535,0.7332,0.1454,0.5115,1,0.5106,1,0.5100,1,0.5071,1,0.5055,1,0.5050,6,0.5035,2,0.5033,1,0.5029,1,0.4930,1,2020-03-05 15:00:00,0,E 01,EBS,510050,50ETF��3�2500,14.32,0.5160,0.4531,443,2161832.00,M,0.4393,C,2020-03-25,20,2,0.504,0.001";
var hq_str_CON_OP_10002284="1,0.4542,0.4596,0.4602,1,1233,18.15,2.5500,0.3888,0.4067,0.6829,0.0951,0.4698,2,0.4696,1,0.4679,1,0.4613,1,0.4602,1,0.4542,1,0.4531,1,0.4434,1,0.4428,1,0.4416,1,2020-03-05 14:46:33,0,E 01,EBS,510050,50ETF��3�2550,16.74,0.4674,0.4023,270,1172730.00,M,0.3890,C,2020-03-25,20,2,0.454,0.0056";
var hq_str_CON_OP_10001937="1,0.4464,0.4460,0.4495,2,6268,16.24,2.5580,0.3837,0.3980,0.6776,0.0898,0.4538,22,0.4534,1,0.4522,1,0.4512,10,0.4495,2,0.4464,1,0.4460,1,0.4457,1,0.4451,1,0.4402,1,2020-03-05 14:55:52,0,E 01,EBS,510050,50ETF��3�2558A,16.91,0.4599,0.3950,812,3602321.08,A,0.3837,C,2020-03-25,20,2,0.446,0";
var hq_str_CON_OP_10002285="1,0.4051,0.4060,0.4093,1,1824,19.06,2.6000,0.3410,0.3553,0.6349,0.0471,0.4180,6,0.4169,1,0.4120,1,0.4105,1,0.4093,1,0.4051,1,0.4035,1,0.4000,1,0.3950,1,0.3949,1,2020-03-05 14:54:46,0,E 01,EBS,510050,50ETF��3�2600,18.33,0.4159,0.3534,1134,4421563.00,M,0.3410,C,2020-03-25,20,2,0.404,0.002";
var hq_str_CON_OP_10001933="1,0.3983,0.3972,0.4036,1,3308,19.49,2.6070,0.3324,0.3476,0.6263,0.0385,0.4110,1,0.4094,1,0.4051,1,0.4045,10,0.4036,1,0.3983,1,0.3966,1,0.3923,10,0.3882,1,0.3865,1,2020-03-05 14:54:14,0,E 01,EBS,510050,50ETF��3�2607A,18.08,0.4073,0.3472,506,1990874.79,A,0.3324,C,2020-03-25,20,2,0.397,0.0002";
var hq_str_CON_OP_10002286="1,0.3560,0.3539,0.3595,5,4136,21.41,2.6500,0.2915,0.3063,0.5854,0.0001,0.3626,1,0.3614,1,0.3598,5,0.3596,1,0.3595,5,0.3560,1,0.3544,1,0.3526,10,0.3470,1,0.3455,1,2020-03-05 14:56:38,0,E 01,EBS,510050,50ETF��3�2650,22.02,0.3680,0.3038,2248,7596257.00,M,0.2915,C,2020-03-25,20,2,0.354,-0.0001";
var hq_str_CON_OP_10001929="1,0.3491,0.3518,0.3545,1,2471,24.05,2.6570,0.2836,0.2965,0.5775,0.0001,0.3637,1,0.3590,1,0.3575,1,0.3556,11,0.3545,1,0.3491,1,0.3475,1,0.3432,10,0.3402,1,0.3389,1,2020-03-05 14:48:16,0,E 01,EBS,510050,50ETF��3�2657A,23.66,0.3631,0.2960,490,1677430.59,A,0.2836,C,2020-03-25,20,2,0.347,0.0048";
var hq_str_CON_OP_10002065="1,0.3070,0.3062,0.3090,1,14271,24.52,2.7000,0.2459,0.2610,0.5398,0.0001,0.3155,1,0.3133,1,0.3130,1,0.3126,1,0.3090,1,0.3070,1,0.3060,12,0.3059,1,0.3058,1,0.3053,2,2020-03-05 14:55:05,0,E 01,EBS,510050,50ETF��3�2700,25.95,0.3200,0.2562,4845,14034069.00,M,0.2459,C,2020-03-25,20,2,0.304,0.0022";
var hq_str_CON_OP_10001909="1,0.3011,0.3000,0.3064,1,2453,26.10,2.7060,0.2379,0.2522,0.5318,0.0001,0.3138,2,0.3136,1,0.3098,1,0.3073,1,0.3064,1,0.3011,1,0.2996,1,0.2976,10,0.2964,1,0.2932,1,2020-03-05 14:56:53,0,E 01,EBS,510050,50ETF��3�2706A,26.90,0.3139,0.2499,1076,3044899.84,A,0.2379,C,2020-03-25,20,2,0.298,0.002";
var hq_str_CON_OP_10002066="6,0.2600,0.2600,0.2623,10,13716,30.65,2.7500,0.1990,0.2112,0.4929,0.0001,0.2693,1,0.2656,1,0.2646,1,0.2638,1,0.2623,10,0.2600,6,0.2585,21,0.2575,1,0.2573,1,0.2571,1,2020-03-05 15:00:00,0,E 01,EBS,510050,50ETF��3�2750,31.86,0.2720,0.2086,12034,29269407.00,M,0.1990,C,2020-03-25,20,2,0.254,0.006";

2 REPLIES 2
Highlighted
lala
Level III

Re: How do I convert this file to table form using JSL?

I don't know how to upload the attachment?
Highlighted
txnelson
Super User

Re: How do I convert this file to table form using JSL?

Here is a script that will input your data file, and do the conversions to the formatted file as you show in your entry. I am not exactly sure this is what you want, but it should be a starting point for the answer to your question.

rename.PNG

Names Default To Here( 1 );
dt = Open(
	"<Path to your file?",
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, Other( "\!"" ), 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" )
	)
);

// Convert the first column to just the last set of numbers
For Each Row( :Column 1 = Word( -1, :Column 1, "=_" ) );

// Rename the column names
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

For( i = 1, i <= N Cols( dt ), i++,
	firstCharacterPosition = Floor( i / 26 );
	If( firstCharacterPosition == 0,
		firstCharacter = "",
		firstCharacter = Substr( alphabet, firstCharacterPosition, 1 )
	);
	secondCharacterPosition = Mod( i, 26 );
	If( secondCharacterPosition == 0,
		secondCharacterPosition = 26
	);
	secondCharacter = Substr( alphabet, secondCharacterPosition, 1 );
	Column( i ) << set name( firstCharacter || secondCharacter );
);
Jim
Article Labels

    There are no labels assigned to this post.