            (recur (+ page-num 1)))))
      (info "Finished OPS collections translation.")))
 
+(defn- validation-result->row
+  "Take a validation result and return a row formatted for CSV"
+  [result]
+  (let [{:keys [provider-id concept-id entry-title errors]} result
+        error-string (str/join "; " errors)]
+    [provider-id concept-id entry-title error-string]))
+
 #_(deftest ops-collections-validation
    (testing "get-collections the current collections in ops against the current UMM schema"
      (def results (get-ops-collections-umm-validation-errors))
+     (let [rows (cons CSV_HEADER
+                      (map validation-result->row (flatten results)))
+           string-writer (StringWriter.)]
+       (if write-errors-to-file
+         (with-open [out-file (io/writer CSV_FILENAME)]
+           (csv/write-csv out-file rows))
+         (do
+           (csv/write-csv string-writer rows)
+           (def error-csv (str string-writer)))))
     (info "Finished OPS collections translation.")))
 
 (comment

(use-fixtures :each (ingest/reset-fixture {"provguid1" "PROV1"}))

(def context (lkt/setup-context-for-test lkt/sample-keyword-map))

(def starting-page-num
  "The starting page-num to retrieve collections for the translation test."

  "Translate OPS collections into various supported metadata formats."
  (:require
    [clj-http.client :as client]
    [clojure.data.csv :as csv]
    [clojure.java.io :as io]
    [clojure.string :as str]
    [clojure.test :refer :all]
    [cmr.common.concepts :as concepts]
