Last active
August 29, 2015 14:01
-
-
Save 7shi/3196120a272a2601ddbd to your computer and use it in GitHub Desktop.
[F#]apoutのログを変換
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
open System | |
let rec loop () = | |
let line = Console.ReadLine () | |
if line <> null then | |
if line.Length > 60 then | |
let mne = line.[60..].Split(' ').[0] | |
printfn "%s %s:%s" line.[0..23] line.[40..43] mne | |
loop () | |
loop () |
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
open System | |
let conv8 s = Convert.ToInt32(s, 8) | |
let rec loop () = | |
let line = Console.ReadLine () | |
if line <> null then | |
let vals = line.Split(' ') |> Array.filter ((<>) "") | |
if vals.Length = 12 then | |
printfn "%04x %04x %04x %04x %04x %04x:%s" | |
(conv8 vals.[3]) (conv8 vals.[4]) | |
(conv8 vals.[5]) (conv8 vals.[6]) | |
(conv8 vals.[7]) (conv8 vals.[0]) vals.[2] | |
loop () | |
loop () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment