mirror of
https://github.com/jackfoxy/urQL.git
synced 2024-12-14 09:33:25 +03:00
23 lines
555 B
Plaintext
23 lines
555 B
Plaintext
// glue-hoon-list.fsx
|
|
open System
|
|
open System.IO
|
|
|
|
//fsi.CommandLineArgs
|
|
|
|
let args = Environment.GetCommandLineArgs()
|
|
|
|
let inFile =
|
|
File.ReadAllLines(Path.Combine([|args.[2]|]))
|
|
|
|
let rec loop (acc : string) n =
|
|
match n with
|
|
| 0 -> loop (acc + inFile.[0].Trim().Replace(" ]", "]")) 1
|
|
| n when n = inFile.Length -> acc
|
|
| _ ->
|
|
if inFile.[n].Trim() = "]" then
|
|
loop (acc + inFile.[n].Trim()) (n + 1)
|
|
else
|
|
loop (acc + " " + inFile.[n].Trim().Replace(" ]", "]")) (n + 1)
|
|
|
|
File.WriteAllText((args.[2] + "2"), (loop "" 0))
|