(* Handy tool for managing CSV files.
- * $Id: csvtool.ml,v 1.9 2006-12-05 22:24:44 rich Exp $
+ * $Id: csvtool.ml,v 1.10 2006-12-05 22:40:38 rich Exp $
*)
open Printf
in
List.iter (
fun filename ->
- let in_chan = open_in filename in
+ let in_chan, close =
+ match filename with
+ | "-" -> stdin, false
+ | filename -> open_in filename, true in
load_rows ~separator:input_sep f in_chan;
- close_in in_chan
+ if close then close_in in_chan
) files
let rec uniq = function