こちらのツールを使います。
以下のcsvファイルを入力にしてみます。
air-routes-latest-edges.csv
~id,~from,~to,~label,dist:int
3748,1,3,route,809
3749,1,4,route,214
3750,1,5,route,945
3751,1,6,route,576
実行
% python csv-gremlin.py air-routes-latest-edges.csv > air-routes-latest-edges
Processing Summary
------------------
Rows=5, IDs=4, Duplicate IDs=0, Vertices=0, Edges=4, Properties=4, Errors=0
%
結果
air-routes-latest-edges
g
.addE("route").property(id,"3748").from(V("1")).to(V("3")).property("dist",809)
.addE("route").property(id,"3749").from(V("1")).to(V("4")).property("dist",214)
.addE("route").property(id,"3750").from(V("1")).to(V("5")).property("dist",945)
.addE("route").property(id,"3751").from(V("1")).to(V("6")).property("dist",576)
参考