Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rename all files by F#
open System;;
open System.IO;;
let dir = @"c:\workdir";;
Directory.GetFiles(dir)
|> Seq.map (fun x-> (x, x.Replace("original", "replaced")))
|> Seq.iter (fun (x,y) -> File.Move(x, y));;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment