Skip to content

Instantly share code, notes, and snippets.

@7shi 7shi/7runconv.fsx
Last active Aug 29, 2015

Embed
What would you like to do?
[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
You can’t perform that action at this time.