The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Convert string to double in column value
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

dwheeler

USA
3 Posts

Posted - 08/27/2013 :  12:35:59 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin 9.0.0 SR2
Operating System: Windows XP SP3

I have a worksheet filled with the contents of a batch processing. The first column of the summary sheet is the filename. I'd like to insert a "B" column that contains a numeric value extracted from the filename in column A.

I've gotten as far as this:

In the "Set values" dialog box, I insert the following:

col(b)=

Substitute(Mid(Col("Dataset"),11,6)$,".","_")


The results in col(b) being filled with the correct information, but it's formatted as a string, and so I can't do a subsequent calculation on that data Is there a way to convert this string to a double using the "Set values" dialog? Or is this a quick thing I can throw into the script window?

Hideo Fujii

USA
1582 Posts

Posted - 08/27/2013 :  3:01:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi dwheeler,

Maybe you can try this way:

Say, your numeric strings are stored in col(B), you can run the Set Column Values tool
with the following formula:
[In the "Before Formula Scripts" box]: 
  dataset loose1;
  copy col(B) loose1;
[In the main "Col(C)=" formula box]: 
  loose1
Here, loose1 is a name of a loose dataset, which has the numeric dataset type, and the strings are converted to numeric values.

Does it work?

--Hideo Fujii
OriginLab
Go to Top of Page

snowli

USA
1379 Posts

Posted - 08/27/2013 :  4:49:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
BTW dwheeler,

Sorry for the inconvenience, in coming 9.1, we have added a Value() function which can change numeric strings into numeric.

Thanks, Snow Li
OriginLab Corp.


Edited by - snowli on 08/27/2013 4:49:49 PM
Go to Top of Page

dwheeler

USA
3 Posts

Posted - 08/28/2013 :  3:08:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That works perfectly, thank you.

quote:
Originally posted by Hideo Fujii

Hi dwheeler,

Maybe you can try this way:

Say, your numeric strings are stored in col(B), you can run the Set Column Values tool
with the following formula:
[In the "Before Formula Scripts" box]: 
  dataset loose1;
  copy col(B) loose1;
[In the main "Col(C)=" formula box]: 
  loose1
Here, loose1 is a name of a loose dataset, which has the numeric dataset type, and the strings are converted to numeric values.

Does it work?

--Hideo Fujii
OriginLab

Go to Top of Page

dwheeler

USA
3 Posts

Posted - 08/28/2013 :  3:11:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
That's great news! It seemed like a simple function, and I couldn't seem to find any documentation on it glad to know I wasn't just missing it.

quote:
Originally posted by snowli

BTW dwheeler,

Sorry for the inconvenience, in coming 9.1, we have added a Value() function which can change numeric strings into numeric.

Thanks, Snow Li
OriginLab Corp.



Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000