{"id":10523,"date":"2025-02-15T21:49:59","date_gmt":"2025-02-15T12:49:59","guid":{"rendered":"https:\/\/www.xenos.jp\/~zen\/blog2\/?p=10523"},"modified":"2025-02-15T21:50:01","modified_gmt":"2025-02-15T12:50:01","slug":"post-10523","status":"publish","type":"post","link":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/2025\/02\/15\/post-10523\/","title":{"rendered":"PowerShell\u3067CSV\u30d5\u30a1\u30a4\u30eb\u3092JSON\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b"},"content":{"rendered":"\n<p>Windows\u3067\u3001Excel\u306e\u8868\u3092JSON\u306b\u5f62\u5f0f\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3067\u3001Excel\u304b\u3089CSV\u30d5\u30a1\u30a4\u30eb\u3067\u4fdd\u5b58\u3057\u3066\u3001Powershell\u3092\u4f7f\u3063\u3066\u3001CSV\u30d5\u30a1\u30a4\u30eb\u3092JSON\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5909\u63db\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u4f7f\u3063\u305fPowershell\u306e\u30b9\u30af\u30ea\u30d7\u30c8\uff08\u30b3\u30de\u30f3\u30c9\u30ec\u30c3\u30c8\uff09\u306f\u4e0b\u8a18\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># CSV\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\n$csvFilePath = \"C:\\path\\to\\your\\file.csv\"\n\n# JSON\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6307\u5b9a\n$jsonFilePath = \"C:\\path\\to\\your\\file.json\"\n\n# CSV\u30d5\u30a1\u30a4\u30eb\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\n$csvData = Import-Csv -Path $csvFilePath\n\n# JSON\u30d5\u30a1\u30a4\u30eb\u306b\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\n$csvData | ConvertTo-Json | Set-Content -Path $jsonFilePath<\/code><\/pre>\n\n\n\n<p>\u6700\u521d\u306e\uff12\u3064\u306f\u3001CSV\u30d5\u30a1\u30a4\u30eb\u3068\u51fa\u529b\u3059\u308bJSON\u30d5\u30a1\u30a4\u30eb\u306e\u6307\u5b9a\u306a\u306e\u3067\u3001\u76f4\u63a5\u6307\u5b9a\u3059\u308c\u30702\u884c\u3067OK\u3002<\/p>\n\n\n\n<p>\uff11\u884c\u305a\u3064\u3001Powershell\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u5165\u529b\u3057\u3066\u3044\u3051\u3070\u5b9f\u884c\u3067\u304d\u308b\u306e\u3067\u697d\u3002\u6587\u5b57\u30b3\u30fc\u30c9\u306f\u5168\u90e8\u304cUTF8\u3067\u884c\u3046\u60f3\u5b9a\u3060\u3063\u305f\u306e\u3067\u6307\u5b9a\u3057\u3066\u3044\u306a\u3044\u304c\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows\u3067\u3001Excel\u306e\u8868\u3092JSON\u306b\u5f62\u5f0f\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3067\u3001Excel\u304b\u3089CSV\u30d5\u30a1\u30a4\u30eb\u3067\u4fdd\u5b58\u3057\u3066\u3001Powershell\u3092\u4f7f\u3063\u3066\u3001CSV\u30d5\u30a1\u30a4\u30eb\u3092JSON\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5909\u63db\u3057\u305f\u3002 \u4f7f\u3063\u305fPowershell [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[13,238],"class_list":["post-10523","post","type-post","status-publish","format-standard","hentry","category-tech-memo","tag-powershell","tag-windows11"],"_links":{"self":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/10523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/comments?post=10523"}],"version-history":[{"count":1,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/10523\/revisions"}],"predecessor-version":[{"id":10524,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/posts\/10523\/revisions\/10524"}],"wp:attachment":[{"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/media?parent=10523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/categories?post=10523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xenos.jp\/~zen\/blog2\/index.php\/wp-json\/wp\/v2\/tags?post=10523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}