{"id":4683,"date":"2016-01-04T13:09:01","date_gmt":"2016-01-04T04:09:01","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=4683"},"modified":"2016-01-05T09:39:43","modified_gmt":"2016-01-05T00:39:43","slug":"textinput","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/textinput\/","title":{"rendered":"\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\uff1a\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\uff08Input # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\uff09"},"content":{"rendered":"<h2>Input # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/h2>\n<div class=\"m30-l\">\n<p><a href=\"https:\/\/excelwork.info\/excel\/textopenclose\/\">Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/a> \u3092<strong>\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u5165\u529b\u30e2\u30fc\u30c9\uff08Input\uff09<\/strong> \u307e\u305f\u306f <strong>\u30d0\u30a4\u30ca\u30ea\u30e2\u30fc\u30c9\uff08Binary\uff09<\/strong>\u3067\u3001\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u30ab\u30f3\u30de\uff08,\uff09\u3067\u533a\u5207\u3089\u308c\u305f\u5358\u4f4d\u3067\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002\u5165\u529b\u30c7\u30fc\u30bf\u5185\u306e\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\uff08&#8221;\uff09\u306f\u7121\u8996\u3055\u308c\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u69cb\u6587\u3011<\/strong><\/p>\n<p>    <strong>Input<\/strong> <strong>#<\/strong><em>filenumber<\/em>, <em>varlist<\/em>, &#8230;<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>filenumber&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<strong>Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong> \u3067\u3001\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>varlist&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u8aad\u307f\u8fbc\u307e\u308c\u305f\u5024\uff08\u30ab\u30f3\u30de\u3067\u533a\u5207\u3089\u308c\u305f\u5185\u5bb9\uff09\u3092\u683c\u7d0d\u3059\u308b\u5909\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u8907\u6570\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3001\u30ab\u30f3\u30de\uff08,\uff09\u3067\u533a\u5207\u3063\u3066\u6307\u5b9a\u3057\u307e\u3059\uff08\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u30c7\u30fc\u30bf\u9805\u76ee\u306e\u500b\u6570\u3001\u9806\u756a\u3068\u4e00\u81f4\u3055\u305b\u307e\u3059\uff09\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<p class=\"caution4\"><strong>Input # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\u3067\u8aad\u307f\u53d6\u3089\u308c\u305f\u30c7\u30fc\u30bf\u306f\u3001\u901a\u5e38\u3001<strong>Write # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\u3067\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307e\u308c\u307e\u3059\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>Input # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 \u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"Input # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_Input()\r\n\r\n    '\u30ab\u30f3\u30de\u533a\u5207\u308a\u306e\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3080\uff08Input \u30e2\u30fc\u30c9\u30fbInput # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\uff09\r\n    \r\n    Dim FileName As String\r\n    Dim FNum As Integer\r\n    Dim buf(2)\r\n    Dim str As String\r\n    Dim i As Integer\r\n    \r\n    FileName = \"C:\\Documents\\mydata\\file01.txt\"\r\n    FNum = FreeFile     '\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u53d6\u5f97\r\n    \r\n    If Dir(FileName) = \"\" Then\r\n        MsgBox \"\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\"\r\n        Exit Sub\r\n    End If\r\n    \r\n    '\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\uff08Input \u30e2\u30fc\u30c9\uff09\r\n    Open FileName For Input As #FNum\r\n    \r\n        Do Until EOF(FNum)\r\n        \r\n            '\u30c7\u30fc\u30bf\u3092\u30ab\u30f3\u30de\u3067\u533a\u5207\u3089\u308c\u305f\u5358\u4f4d\u3054\u3068\u306b\u8aad\u307f\u8fbc\u3080\r\n            Input #FNum, buf(0), buf(1), buf(2)\r\n            str = str & Join(buf, vbTab) & vbCrLf\r\n        \r\n        Loop\r\n\r\n    '\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\r\n    Close #FNum\r\n\r\n    '\u5185\u5bb9\u3092\u8868\u793a\r\n    MsgBox str\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u8aad\u307f\u8fbc\u3080\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/textinput00a.jpg?ssl=1\" rel=\"lightbox[4683]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/textinput00a.jpg?resize=580%2C308&#038;ssl=1\" alt=\"\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\" width=\"580\" height=\"308\" class=\"alignnone size-large wp-image-4727\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/textinput00a.jpg?resize=580%2C308&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/textinput00a.jpg?resize=400%2C213&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/textinput00a.jpg?w=621&amp;ssl=1 621w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><br \/>\n  <br \/><\/p>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 \u3092\u5b9f\u884c<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/textinput01a.jpg?ssl=1\" rel=\"lightbox[4683]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/textinput01a.jpg?resize=300%2C215&#038;ssl=1\" alt=\"Input # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\" width=\"300\" height=\"215\" class=\"alignnone size-full wp-image-4728\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>Input # \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 \u3092\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u5165\u529b\u30e2 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4825,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[675],"tags":[693,733,63,38],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/textinput00a-580x308.jpg?fit=580%2C308&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1dx","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4683"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=4683"}],"version-history":[{"count":9,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4683\/revisions"}],"predecessor-version":[{"id":4845,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4683\/revisions\/4845"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/4825"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=4683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=4683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=4683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}