How to convert char to num<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Dear All,
I have the data as follows and whatever I tried I can't make the new formula column a numeric one.
Could someone help please?
many thanks in advance

Re: How to convert char to numGiven all the questions, and the length of this post. I'm just going to let you know, it'd be worth the hour of your time to study regular expressions. Regular expressions are a very common programming technique that is universal and can be found in almost all programming languages. Regular expressions can do everything above and more.
The JSL Scripting guide has a very good subsection that should cover all you need to know about the regex() function. And there are plenty of YouTube videos that go in depth as well.
Re: How to convert char to numMany thanks, both work.
Re: How to convert char to numSaitcopuroglu,
You should be able to use the following formula:
Num(Word(1,:Score, "/"))/Num(Word(1,:Score, "/"))
Dave
Re: How to convert char to numI have not read the whole thread. But perhaps this is close (if you can depend on the 'divide' delimiter):
New Table( "Convert Char Fraction",
Add Rows( 4 ),
New Column( "Char Fraction",
Character,
"Nominal",
Set Values( {"4 / 5", "3/2", "27/ 26", "122 /37.6"} )
),
New Column( "Result",
Numeric,
"Continuous",
Format( "Fixed Dec", 12, 3 ),
Formula(
Num( Trim( Word( 1, :Char Fraction, "/" ) ) ) /
Num( Trim( Word( 2, :Char Fraction, "/" ) ) )
)
)
);
Re: How to convert char to numDear all,
again to same topic this time I can not create a formula column which divides the first number by second number (4/5, 44./5, 7.3/10...etc...)
Substraction does not work cos no equal lenght, Substitute is not a way to go Words can not seperate the characters....
many thanks!

Re: How to convert char to numI think I am seeing a quotation mark inside the quoted string in the image you supplied. JMP strings need escapes too, and it gets confusing. Try using \!" to replace " in the string. the apostrophe ( ' ) is OK, just the quotation mark ( " ) needs help. I get several error dialogs when I do it wrong. Not sure why you are seeing a hang, maybe the dialog is behind the window.
Lowercase(Regex(:source text, "[!'\!"+%/=()]+", " ", GLOBALREPLACE))
Re: How to convert char to numwhen I fill the expression with exclamation marks JMP stops opeartiong and forces me to force quit the whole application am i doin sthg wrong?
the screenshot is where JMP freezed, dont know exactly which exclamation mark caused it...

Re: How to convert char to numYes, if GLOBALREPLACE will work in place of a for-loop, it will be much faster for several reasons: the internal loop will be faster than the JSL loop and the internal regex GLOBALREPLACE doesn't start over after each replacement and the result string is built in a single pass. Which makes a big difference if there are a lot of replacements in a long string.
Re: How to convert char to numI was not aware or the GLOBALREPLACE option. Thanks for pointing that out to me. Bye Regex loops.
Re: How to convert char to numNew Table( "Untitled", Add Rows( 2 ), New Column( "source text", Character, "Nominal", Set Values( {"AbCd!@#GhI!!31", "aa BB CCCC"} ) ), New Column( "formula column", Character, "Nominal", Formula( Lowercase( Regex( :source text, "[!@# ]+", " ", GLOBALREPLACE ) ) ) )) The regex means:
[ ... ] defines a set of characters, in this case, bang, at, pound, and space. Well, that's what I call them. the plus means one or more of the items in the set. The only issue is what characters in the set must be escaped with a backslash: regex - What special characters must be escaped in regular expressions? - Stack Overflow says the characters to escape inside [ ] are ^-]\ (which includes the \ escape character, of course.) If you needed a minus in the set, you could add it like "[!@# \-]+". You can escape other characters too, but it just makes it hard to read, and the ! is especially hard since it collides with JSL's escape: "[\!\!\@\#\ \-]+" (wow! \!\ is a \, then ! is itself.).
the regex matches runs of characters in the set and replaces them with a single space. GLOBALREPLACE means repeat the operation as many times as possible.
write("[\!\!\@\#\ \-]+")[\!\@\#\ \-]+The site I refer to for regex help is Regular Expression Tutorial - Learn How to Use Regular Expressions
Re: How to convert char to numThank you MS,
Thank you jvillaumie,
Both work very well !
I am continuously checking the tutorials, books, help, webcasts but sometimes when it comes to action some very simple thing is missing. In this example I knew the Substitute function but did not know it could be surrounded by another Substitute and another and another and by collapse whitespace and lowercase functions...
Many many thanks again, it saved me 8 minutes for each day of my rest life...
Re: How to convert char to numTo get a slightly simpler formula, use multiple arguments in Substitute().
For example:
Substitute(:Comment, "!", " ", "+", " ", "%", " ", "_", " ", "-", " ", "?", " ");
Re: How to convert char to numSaitcopuroglu, you can use substitute() to replace any string you want (and special characters are strings). You can have multiple substitutes "inside" each other, with each substituting a special character by a space " ", or nothing "" or whatever you like "really anything".
Then there are separate character functions to remove whitespace and turn to lowercase.
The JMP help (F1) for Character functions is really good to see what can be done; you may want to have a look.
You will find the formula of the last column pasted below the picture so you can re-use it easily. Add more Substitutes() as required to remove other special characters I have missed out.

Lowercase(Collapse Whitespace(Substitute(Substitute(Substitute(Substitute(Substitute(Substitute(:Comment, "!", " "), "+", " "), "%", " "), "_", " "), "-", " "), "?", " ")))
Re: How to convert char to numDear Craige,
Thank you for the very useful link.
I was looking forward for a long time for jsl capabilities of CTRL+F and REPLACE function. There is a line about it in your link but I couldn't get success.
I have a column (comment) with full of text and I would like to replace all exclamation marks with spaces and then collapse whitespace and make all lowercase.
what should be the jsl for:
find "'" + ! % / = ( ) : ; ? _ – ; - . , " and replace with " "
collapse whitespace
make lowercase
Many thanks in advance

Re: How to convert char to numSaitcopuroglu,
Here’s a simple table with the formula in the second column illustrating the Munger function.
Dave
Re: How to convert char to numJSL Character String Functions
Re: How to convert char to numthank you dlee0416, could you please send the jmp data table? I am not familiar with Munger function and additional knowledge is always welcome. many thanks
Re: How to convert char to numNot to beat a dead horse but you can still use the Num(Substr(….) option by doing the following.
Re: How to convert char to numExactly!
Only changing all the commas to full stops solved the problem on its own with substract function but with substitute function it is safer in case shorter than 5 decimals displayed data (1.50000 »» 1.5).
Many many thanks to all input owners for your support ! (And I will change my local preferences from UK to US)
Re: How to convert char to numYour decimal place separator is a comma, you may need to change it to a full stop for num() to work. I have to, being in the UK. Your local preferences may allow you to work with the comma.
Also, using substr() will work only if all your parity values have the same number of digits. If the number of digits increases, it will crop the value, and if the number of digits decreases, the substr() will keep some of the USD characters and num() won't work at all. I suggest you use substitute() instead of substr() to replace "USD" by nothing, and replace "," by "."

Re: How to convert char to numAnd if you want to add the currency, just go to column info and add to column property "Units" the value "USD", you will get the Units in brackets after the column Name.
Re: How to convert char to num diplays missing data

Re: How to convert char to numThank you, I did it already bu substracting the first 7 digits (which are supposed to be numbers) but cant change the new formula column from char to num
Re: How to convert char to numSurround what you have with num(). That will convert a string to a number.
Re: How to convert char to numI believe that all you need to do is use the 'Num' command in front of your 'Substr' command and it Neill convert to a numeric:
Num(Substr( your column here, 1,7))
Hope this fixes your problem.
Dave
Re: How to convert char to numSaitcopuroglu,
You need to take the "USD" out of the data in the rows. JMP sees this as character data and will not allow you to change to numeric. You will need to a Find and replace or a Recode to try and make the change a little easier on yourself with over 1400 rows.
Best,
Bill