Created
July 7, 2009 13:07
-
-
Save mneedham/142063 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let ExtractValues1 (item:string) = | |
let matchBuildDuration item = Regex.Match(item, "(.*\)),([0-9]+),") | |
Regex.Split(item, "\n") |> | |
Array.map (fun item -> | |
let m = matchBuildDuration item | |
if(m.Success) | |
then { Agent = m.Groups.[1].Value; Duration = m.Groups.[2].Value } | |
else { Agent = ""; Duration = ""} ) |> | |
Array.filter (fun item -> item.Agent <> "" && item.Duration <> "") | |
let ExtractValues2 (item:string) = | |
let matchBuildDuration item = Regex.Match(item, "(.*\)),([0-9]+),") | |
Regex.Split(item, "\n") |> | |
Array.map (fun item -> | |
let m = matchBuildDuration item | |
if(m.Success) | |
then Some({ Agent = m.Groups.[1].Value; Duration = m.Groups.[2].Value }) | |
else None ) |> | |
Array.filter (fun item -> item.IsSome) | |
let ExtractValues3 (response:string) = | |
let matchBuildDuration item = Regex.Match(item, "(.*\)),([0-9]+),") | |
Regex.Split(response, "\n") |> | |
Array.filter (fun x -> (matchBuildDuration x).Success) |> | |
Array.map (fun x -> (matchBuildDuration x).Groups) |> | |
Array.map (fun group -> { Agent = (group.[1].Value); Duration = (group.[2].Value) } ) | |
let ExtractValues (response:string) = | |
Regex.Split(response, "\n") |> | |
Array.map (fun x -> Regex.Match(x, "(.*\)),([0-9]+),")) |> | |
Array.filter (fun x -> x.Success) |> | |
Array.map (fun x -> x.Groups) |> | |
Array.map (fun group -> { Agent = (group.[1].Value); Duration = (group.[2].Value) } ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment