{"id":5524,"date":"2016-05-24T05:32:35","date_gmt":"2016-05-23T20:32:35","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=5524"},"modified":"2016-05-24T05:32:35","modified_gmt":"2016-05-23T20:32:35","slug":"fsoread","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/fsoread\/","title":{"rendered":"TextStream \u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\uff08Read,ReadLine,ReadAll\uff09"},"content":{"rendered":"<h2>ReadAll \u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<p><strong>TextStream \u30d5\u30a1\u30a4\u30eb<\/strong>\u306e\u5185\u5bb9\u5168\u4f53\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>ReadAll \u30e1\u30bd\u30c3\u30c9<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<span class=\"red\"><strong>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>ReadLine \u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<p><strong>TextStream \u30d5\u30a1\u30a4\u30eb<\/strong>\u304b\u3089\uff11\u884c\uff08\u6539\u884c\u6587\u5b57\u306e\u624b\u524d\u307e\u3067\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>ReadLine<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<span class=\"red\"><strong>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>Read \u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<p><strong>TextStream \u30d5\u30a1\u30a4\u30eb<\/strong>\u304b\u3089\u6307\u5b9a\u3057\u305f\u6587\u5b57\u6570\u3092\u8aad\u307f\u53d6\u3063\u3066\u3001\u305d\u306e\u5185\u5bb9\uff08\u6587\u5b57\u5217\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>object<\/em>.<strong>Read<\/strong> ( <em>characters<\/em> )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<span class=\"red\"><strong>TextStream \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>characters&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u8aad\u307f\u53d6\u308b\u6587\u5b57\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>Read  \u30e1\u30bd\u30c3\u30c9\u3001ReadLine \u30e1\u30bd\u30c3\u30c9\u3001ReadAll \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 1<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"ReadAll \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ReadAll()\r\n\r\n    Dim fso As New FileSystemObject\r\n    Dim f As TextStream\r\n\r\n    Set f = fso.OpenTextFile(\"C:\\Documents\\mydata5\\test01.txt\")\r\n    MsgBox f.ReadAll\r\n    f.Close\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readall01.jpg?ssl=1\" rel=\"lightbox[5524]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readall01.jpg?resize=168%2C170&#038;ssl=1\" alt=\"FSO ReadAll \u30e1\u30bd\u30c3\u30c9\" width=\"168\" height=\"170\" class=\"alignnone size-full wp-image-5526\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readall01.jpg?w=168&amp;ssl=1 168w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readall01.jpg?resize=100%2C100&amp;ssl=1 100w\" sizes=\"(max-width: 168px) 100vw, 168px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/>\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 2<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"ReadLine \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ReadLine()\r\n\r\n    Dim fso As New FileSystemObject\r\n    Dim f As TextStream\r\n    Dim str As String\r\n    \r\n    Set f = fso.OpenTextFile(\"C:\\Documents\\mydata5\\test01.txt\")\r\n    \r\n    Do Until f.AtEndOfLine\r\n                \r\n        str = str & f.ReadLine & vbCrLf\r\n\r\n    Loop\r\n    \r\n    f.Close\r\n    \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><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readline01.jpg?ssl=1\" rel=\"lightbox[5524]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readline01.jpg?resize=168%2C170&#038;ssl=1\" alt=\"FSO ReadLine \u30e1\u30bd\u30c3\u30c9\" width=\"168\" height=\"170\" class=\"alignnone size-full wp-image-5527\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readline01.jpg?w=168&amp;ssl=1 168w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readline01.jpg?resize=100%2C100&amp;ssl=1 100w\" sizes=\"(max-width: 168px) 100vw, 168px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/>\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 3<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"ReadA \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_Read()\r\n\r\n    Dim fso As New FileSystemObject\r\n    Dim f As TextStream\r\n    Dim str As String\r\n    \r\n    Set f = fso.OpenTextFile(\"C:\\Documents\\mydata5\\test01.txt\")\r\n    \r\n    Do Until f.AtEndOfStream\r\n                \r\n        str = str & f.Read(1)\r\n\r\n    Loop\r\n    \r\n    f.Close\r\n    \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><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_read01.jpg?ssl=1\" rel=\"lightbox[5524]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_read01.jpg?resize=168%2C170&#038;ssl=1\" alt=\"FSO Read \u30e1\u30bd\u30c3\u30c9\" width=\"168\" height=\"170\" class=\"alignnone size-full wp-image-5528\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_read01.jpg?w=168&amp;ssl=1 168w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_read01.jpg?resize=100%2C100&amp;ssl=1 100w\" sizes=\"(max-width: 168px) 100vw, 168px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>ReadAll \u30e1\u30bd\u30c3\u30c9 TextStream \u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u5168\u4f53\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":5526,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[836],"tags":[721,693,722,834,887,889,888,900,63,38],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/05\/fso_textstream_readall01.jpg?fit=168%2C170&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s4Ye9i-fsoread","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5524"}],"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=5524"}],"version-history":[{"count":3,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5524\/revisions"}],"predecessor-version":[{"id":5571,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/5524\/revisions\/5571"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/5526"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=5524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=5524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=5524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}