Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Jon Stroop
I have zero Excel skills, but chances are you could do this with any scripting language if you were to export the file as text (e.g. CSV). -Jon On 07/02/2013 11:02 AM, Harper, Cynthia wrote: Is there a way to return (in Excel, if possible) the largest 4-digit number (by word boundaries) in a

Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Cary Gordon
If you want to stay in Excel, you can likely do this with Powershell, which supports regex. Thanks, Cary On Jul 2, 2013, at 8:02 AM, Harper, Cynthia char...@vts.edu wrote: Is there a way to return (in Excel, if possible) the largest 4-digit number (by word boundaries) in a string? I've

Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Andreas Orphanides
You might also be able to do it with some kind of naive approach: import to excel as a space-delimited file; whatever the rightmost column ends up being, go one to the right, then you should be able to use the MAX() function (perhaps with some embellishment to ignore non-numeric text) to pick out

Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Kyle Banerjee
AFAIK, Excel has no built in regex capabilities so you'd need to call vbscript from Excel to do this. In any case, you'll need to write an actual program to evaluate each line since multiple values can occur in the same line. This will be easier if done as text than in VBA. Besides, the data in

Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Harper, Cynthia
@LISTSERV.ND.EDU] On Behalf Of Kyle Banerjee Sent: Tuesday, July 02, 2013 11:47 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] Regular expression for maximum 4-digit number AFAIK, Excel has no built in regex capabilities so you'd need to call vbscript from Excel to do this. In any case

Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Kyle Banerjee
Sent: Tuesday, July 02, 2013 11:47 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] Regular expression for maximum 4-digit number AFAIK, Excel has no built in regex capabilities so you'd need to call vbscript from Excel to do this. In any case, you'll need to write an actual program

Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Andreas Orphanides
. Thanks. -Original Message- From: Code for Libraries [mailto:CODE4LIB@LISTSERV.ND.EDU] On Behalf Of Kyle Banerjee Sent: Tuesday, July 02, 2013 11:47 AM To: CODE4LIB@LISTSERV.ND.EDU Subject: Re: [CODE4LIB] Regular expression for maximum 4-digit number AFAIK, Excel has

Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Brad Rhoads
Hi Cindy, You can *almost* use text to column to split the fields out from the string. Then you take the max() of the resulting range. *Except* there's a max of 256 columns. So you'll need to split the string into parts, perhaps into separate worksheets. Then do the text to columns in worksheet

Re: [CODE4LIB] Regular expression for maximum 4-digit number

2013-07-02 Thread Graeme Williams
Assuming you want to stay in Excel, here's VBA code which I think will do what you want: Public Function LargestValueInString(str As String, min As Integer, max As Integer) As Integer Dim match As Variant Dim val As Integer, hival As Integer hival = -1 With CreateObject(VBScript.RegExp)