Skip to content

Instantly share code, notes, and snippets.

@7shi
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7shi/3196120a272a2601ddbd to your computer and use it in GitHub Desktop.
Save 7shi/3196120a272a2601ddbd to your computer and use it in GitHub Desktop.
[F#]apoutのログを変換
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 ()
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