Skip to content

Instantly share code, notes, and snippets.

@jsakamoto
Created June 28, 2012 06:12
Show Gist options
  • Save jsakamoto/3009448 to your computer and use it in GitHub Desktop.
Save jsakamoto/3009448 to your computer and use it in GitHub Desktop.
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