Skip to content

Instantly share code, notes, and snippets.

@mausch
Created May 8, 2010 20:58
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 mausch/394771 to your computer and use it in GitHub Desktop.
Save mausch/394771 to your computer and use it in GitHub Desktop.
open System
open System.IO
let enumFiles = Seq.collect (fun p -> Directory.EnumerateFiles(".", p, SearchOption.AllDirectories))
let procFile f =
printfn "%s" f
let lines = File.ReadLines f
|> Seq.map (fun l -> System.Text.RegularExpressions.Regex.Replace(l, "\r?\n", "\r\n"))
|> Seq.toArray
File.WriteAllLines(f, lines)
enumFiles ["*.cs"; "*.xml"; "*.config"] |> Seq.iter procFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment