susu #7757(2008/10/05 23:50 GMT) [ OCaml ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
let succ_str s = try (string_of_int (int_of_string s + 1)) with Failure _ -> s let read scanbuf f = let t = "\t" and nl = "\n" in Scanf.bscanf scanbuf "%[^\t]\t%[^\t]\t%[^\t]\t%[^\n]%c" (fun a b c d _ -> f [a;t;c;t;b;t; succ_str d; nl]) let f ch = let accu = ref [] in try read ch (List.iter print_string); while true do (read ch (fun l -> accu := l::!accu)) done; with End_of_file -> let l = List.stable_sort (fun a b -> compare (List.hd a) (List.hd b)) !accu in List.iter (List.iter print_string) l;; (* let s = "\ ID\tSurname\tForename\tAge 1\tSato\tHanako\t17 0\tSuzuki\tTaro\t18 " let (path,o) = Filename.open_temp_file "doukaku209_" ".txt";; output_string o s; close_out o;; let sbuf = Scanf.Scanning.from_file path in (f sbuf);; *)
Rating0/0=0.00-0+
[ reply ]
susu
#7757()
[
OCaml
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]