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

extract information from a column in jmp

Hello JMP User,

 

I want to write a script to extract some particular information such Alc%, VA, RS% from :merge and put them in a separate columns. Alc, VA and gravity values are randomly distributed, therefore Recode column would worked iin this case

chandankishor66_0-1664808840772.png

 

Any suggestions will be highly appreciated,

Regards,

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: extract information from a column in jmp

Here is an example script that should get you going with solving your problem.  All of the functions used in the script are documented with examples in the Scripting Index, available under the Help pull down menu

txnelson_0-1664811578736.png

Names Default To Here( 1 );
dt = Current Data Table();

For Each Row(
	If( Contains( :merge, "Alc =" ),
		:Alc % = Num( Word( 2, Substr( :merge, Contains( :merge, "Alc =" ) ), "=%" ) ) / 100
	);
	If( Contains( :merge, "Rs =" ),
		:Rs % = Num( Word( 2, Substr( :merge, Contains( :merge, "Rs =" ) ), "=%" ) ) / 100
	);
	If( Contains( :merge, "VA =" ),
		:VA ppm = Num( Word( 2, Substr( :merge, Contains( :merge, "VA =" ) ), "=p" ) )
	);
	If( Contains( :merge, "Approved" ),
		:Approved By = Word( 3, Substr( :merge, Contains( :merge, "Approved" ) ), " :" )
	);
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: extract information from a column in jmp

Here is an example script that should get you going with solving your problem.  All of the functions used in the script are documented with examples in the Scripting Index, available under the Help pull down menu

txnelson_0-1664811578736.png

Names Default To Here( 1 );
dt = Current Data Table();

For Each Row(
	If( Contains( :merge, "Alc =" ),
		:Alc % = Num( Word( 2, Substr( :merge, Contains( :merge, "Alc =" ) ), "=%" ) ) / 100
	);
	If( Contains( :merge, "Rs =" ),
		:Rs % = Num( Word( 2, Substr( :merge, Contains( :merge, "Rs =" ) ), "=%" ) ) / 100
	);
	If( Contains( :merge, "VA =" ),
		:VA ppm = Num( Word( 2, Substr( :merge, Contains( :merge, "VA =" ) ), "=p" ) )
	);
	If( Contains( :merge, "Approved" ),
		:Approved By = Word( 3, Substr( :merge, Contains( :merge, "Approved" ) ), " :" )
	);
);
Jim
chandankishor66
Level III

Re: extract information from a column in jmp

 

Many thanks  txnelson,

Your suggestion is working for me.