{"id":4812,"date":"2016-01-04T11:04:45","date_gmt":"2016-01-04T02:04:45","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=4812"},"modified":"2016-01-04T11:04:45","modified_gmt":"2016-01-04T02:04:45","slug":"textseekfunction","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/textseekfunction\/","title":{"rendered":"\u958b\u3044\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u73fe\u5728\u306e\u8aad\u307f\u53d6\u308a\u4f4d\u7f6e\u307e\u305f\u306f\u66f8\u304d\u8fbc\u307f\u4f4d\u7f6e\u3092\u53d6\u5f97\uff08Seek \u95a2\u6570\uff09"},"content":{"rendered":"<h2>Seek \u95a2\u6570<\/h2>\n<div class=\"m30-l\">\n<p><a href=\"https:\/\/excelwork.info\/excel\/textopenclose\/\">Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/a> \u3067\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u73fe\u5728\u306e\u8aad\u307f\u53d6\u308a\u4f4d\u7f6e\u307e\u305f\u306f\u66f8\u304d\u8fbc\u307f\u4f4d\u7f6e\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    <strong>Seek<\/strong> ( <em>filenumber<\/em> )<\/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>\u623b\u308a\u5024&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\uff08 1 \uff5e 2,147,483,647\uff08= 2^31 ? 1\uff09\u306e\u7bc4\u56f2\u306e\u6570\uff09\u3002<br \/>\n\t<strong>Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong> \u3092<strong>\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\u30e2\u30fc\u30c9\uff08Random\uff09<\/strong>\u3067\u958b\u3044\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u8aad\u307f\u53d6\u308a\u307e\u305f\u306f\u66f8\u304d\u8fbc\u307f\u304c\u884c\u308f\u308c\u308b<strong>\u30ec\u30b3\u30fc\u30c9\u306e\u756a\u53f7<\/strong>\uff08\u6700\u5f8c\u306b\u8aad\u307f\u66f8\u304d\u3092\u884c\u3063\u305f\u30ec\u30b3\u30fc\u30c9\u306e\u6b21\u306e\u756a\u53f7\uff09\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\t<strong>Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong> \u3092<strong>\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u5165\u529b\u30e2\u30fc\u30c9\uff08Input\uff09<\/strong>\u3001<strong>\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u51fa\u529b\u30e2\u30fc\u30c9\uff08Output\uff09<\/strong>\u3001<strong>\u8ffd\u52a0\u30e2\u30fc\u30c9\uff08Append\uff09<\/strong>\u3001<strong>\u30d0\u30a4\u30ca\u30ea\u30e2\u30fc\u30c9\uff08Binary\uff09<\/strong> \u306e\u3044\u305a\u308c\u304b\u3067\u958b\u3044\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u8aad\u307f\u53d6\u308a\u307e\u305f\u306f\u66f8\u304d\u8fbc\u307f\u304c\u884c\u308f\u308c\u308b<strong>\u30d0\u30a4\u30c8\u4f4d\u7f6e<\/strong>\uff08\u6700\u5f8c\u306b\u8aad\u307f\u66f8\u304d\u3092\u884c\u3063\u305f\u30d0\u30a4\u30c8\u756a\u53f7\u306e\u6b21\u306e\u756a\u53f7\uff09\u3068\u306a\u308a\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<br \/>\n<p class=\"caution4\"><strong>Loc \u95a2\u6570<\/strong>\u306e\u5834\u5408<br \/>\n    <strong>\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\u30e2\u30fc\u30c9\uff08Random\uff09<\/strong>\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u5834\u5408\u306f\u3001\u6700\u5f8c\u306b\u8aad\u307f\u66f8\u304d\u3092\u884c\u3063\u305f\u30ec\u30b3\u30fc\u30c9\u756a\u53f7\u3092\u8fd4\u3057\u307e\u3059\u3002\u307e\u305f\u3001<strong>\u30d0\u30a4\u30ca\u30ea\u30e2\u30fc\u30c9\uff08Binary\uff09<\/strong>\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u5834\u5408\u306f\u3001\u6700\u5f8c\u306b\u8aad\u307f\u66f8\u304d\u3092\u884c\u3063\u305f\u30d0\u30a4\u30c8\u756a\u53f7\u3092\u8fd4\u3057\u307e\u3059\u3002<strong>\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u30e2\u30fc\u30c9\uff08Input\u3001Output\u3001Append\uff09<\/strong>\u306e\u5834\u5408\u306f\u3001\u73fe\u5728\u306e\u30d0\u30a4\u30c8\u4f4d\u7f6e\u3092 128 \u3067\u5272\u3063\u305f\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>Seek \u95a2\u6570 \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=\"Seek \u95a2\u6570 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_SeekFunction()\r\n\r\n    Dim FileName As String\r\n    Dim FNum As Integer\r\n    Dim buf As String\r\n    Dim str As String\r\n        \r\n    FileName = \"C:\\Documents\\mydata\\test03.txt\"\r\n    FNum = FreeFile\r\n    \r\n    '\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\r\n    Open FileName For Input As #FNum\r\n    \r\n    Do Until EOF(FNum)\r\n    \r\n        Line Input #FNum, buf\r\n        str = str & buf & \"\uff1a\" & Seek(FNum) & \"\u30d0\u30a4\u30c8\" & 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    MsgBox str\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 \u3067\u3001\u8aad\u307f\u8fbc\u3080\u30d5\u30a1\u30a4\u30eb\u300ctest03.txt\u300d\u306e\u5185\u5bb9<\/p>\n<p>  <a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/seekfunction00.jpg?ssl=1\" rel=\"lightbox[4812]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/seekfunction00.jpg?resize=580%2C304&#038;ssl=1\" alt=\"Seek \u95a2\u6570 00\" width=\"580\" height=\"304\" class=\"alignnone size-large wp-image-4813\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/seekfunction00.jpg?resize=580%2C304&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/seekfunction00.jpg?resize=400%2C210&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/seekfunction00.jpg?w=658&amp;ssl=1 658w\" 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\u3057\u305f\u7d50\u679c<\/p>\n<p>  <a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/seekfunction01.jpg?ssl=1\" rel=\"lightbox[4812]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/seekfunction01.jpg?resize=189%2C260&#038;ssl=1\" alt=\"Seek \u95a2\u6570 01\" width=\"189\" height=\"260\" class=\"alignnone size-full wp-image-4814\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>Seek \u95a2\u6570 Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 \u3067\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u73fe\u5728\u306e\u8aad\u307f\u53d6\u308a\u4f4d\u7f6e &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4820,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[675],"tags":[693,731,746,63,38,729],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2016\/01\/seekfunction00-580x304-1.jpg?fit=580%2C304&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1fC","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4812"}],"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=4812"}],"version-history":[{"count":4,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4812\/revisions"}],"predecessor-version":[{"id":4821,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4812\/revisions\/4821"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/4820"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=4812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=4812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=4812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}