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
 All Forums
 Origin Forum
 Origin Forum
 Convert string to double in column value

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
dwheeler Posted - 08/27/2013 : 12:35:59 PM
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?
4   L A T E S T    R E P L I E S    (Newest First)
dwheeler Posted - 08/28/2013 : 3:11:56 PM
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.



dwheeler Posted - 08/28/2013 : 3:08:29 PM
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

snowli Posted - 08/27/2013 : 4:49:25 PM
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.

Hideo Fujii Posted - 08/27/2013 : 3:01:45 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000