program

kintoneから出力したcsvをpostgresにインポートする

ここに概要を書く

あああ

kintoneから出力したcsvをpostgresにインポートする

  • aaaaa
  • bbbb
  • ccccccccc

  1. aaaaaaaaaa
  2. bbbbbbbbbbb
  3. dddddddddddddd

対象CSV

"レコード番号","キー","名前","体重","日付","備考"
"221","A218","田中","86.5","2022/12/01","aaaaaa
bbb
cccc"
"220","A217","斎藤","65.7","2022/12/31","いいい
ううう
えええ"
"219","A216","鈴木","12.4","2022/12/07","ああああああああああ
いいいいいいい"
"218","A215","田中","86.5","2022/12/01","aaaaaa
bbb
cccc"
"217","A214","斎藤","65.7","2022/12/31","いいい
ううう
えええ"
"216","A213","鈴木","12.4","2022/12/07","ああああああああああ
いいいいいいい"
"215","A212","田中","86.5","2022/12/01","aaaaaa
bbb
cccc"
"214","A211","斎藤","65.7","2022/12/31","いいい
ううう
えええ"
"213","A210","鈴木","12.4","2022/12/07","ああああああああああ
いいいいいいい"
"212","A209","田中","86.5","2022/12/01","aaaaaa
bbb
cccc"

テーブル作成

CREATE TABLE IF NOT EXISTS tbl2 (
    "レコード番号" integer,
    "キー" text,
    "名前" text,
    "体重" numeric,
    "日付" date,
    "備考" text
);

インポート

COPY tbl2 ("レコード番号", "キー", "名前", "体重", "日付", "備考")
FROM 'C:\temp\kintone.csv'
DELIMITER ','
CSV HEADER;