Skip to content

Instantly share code, notes, and snippets.

@jsakamoto
Created June 28, 2012 06:12
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 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