2013-06-22から1日間の記事一覧

Clojureでxmlを読み込んでみたのでメモ

Clojureでxmlを読み込んでみたのでメモ。 core.clj (ns xmlhello.core (:require [clojure.xml :as xml])) (defn load-xml-seq [filepath] (xml-seq (xml/parse (java.io.File. filepath)))) data.xml(Leiningenによるプロジェクトフォルダ直下に格納) <records> <record id="1">re</record></records>…

Windows PowerShell で UTF8 のファイルの中身をソート

cmd の sort は UTF8 対応とかないので、 PowerShell でのやり方をメモ。 powershell -command "Get-Content -Encoding UTF8 in.txt | sort | Set-Content -Encoding UTF8 out.txt"以上。

Windows PowerShell で ファイルを最終更新日で仕分け

久々にPowerShellネタ。 ファイルを最終更新日フォルダへ振分けるスクリプトを書いてみた。 move_files.ps1 #カレントディレクトリ以下(再帰)のファイルについて、下記マップを生成します。 # 更新日yyyyMMdd -> @(file_obj1, file_obj2, ..) Function Get-D…

xmlから取得したデータを用いて、HiccupでHTML出力メモ

Hiccup を利用してxmlから取得したデータを用いたHTML生成のメモ。 (ns xmlhello.core (:require [clojure.xml :as xml] [hiccup.core :as hic])) (defn load-xml-seq [filepath] (xml-seq (xml/parse (java.io.File. filepath)))) ; Hiccup を用いて、xmlか…