{"id":1198,"date":"2019-03-25T17:34:02","date_gmt":"2019-03-25T20:34:02","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/kb12658-readingwriting-txt-files-with-e3\/"},"modified":"2020-01-08T16:11:59","modified_gmt":"2020-01-08T19:11:59","slug":"kb12658-readingwriting-txt-files-with-e3","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/","title":{"rendered":"KB-12658: Reading\/Writing TXT files with E3."},"content":{"rendered":"<div style=\"text-align: justify;\"><b>Question:<\/b><\/div>\n<p class=\"MsoNormal\" style=\"text-align: justify;\">How can I read\/write TXT files with E3?<\/p>\n<p class=\"MsoNormal\" style=\"text-align: justify;\"><b>Solution:<\/b><\/p>\n<p class=\"MsoNormal\" style=\"text-align: justify;\">To do so, you must use the methods from <span style=\"font-weight: bold;\">FileSystemObject <\/span>object.<\/p>\n<p class=\"MsoNormal\"><span style=\"font-weight: bold;\">Examples: <\/span><\/p>\n<p><b>** Script to create a TXT file **<\/b><\/p>\n<p class=\"MsoNormal\" style=\"font-family: Courier New; color: #000000;\">Dim aux, aux1<\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: Courier New; color: #000000;\">Set aux = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br \/>\nSet aux1 = aux.CreateTextFile(&#8220;C:\\Temp\\Test.txt&#8221;, True)<br \/>\naux1.Close<\/span><i><br \/>\n<\/i><\/p>\n<p><b>** Script to add text to the file **<\/b><\/p>\n<p class=\"MsoNormal\" style=\"font-family: Courier New; color: #000000;\">Dim aux, aux1<\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: Courier New; color: #000000;\">Set aux = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br \/>\nSet aux1 = aux.OpenTextFile(&#8220;C:\\Temp\\Test.txt&#8221;,8)<br \/>\naux1.WriteLine &#8221; Adds text to the file &#8221;<br \/>\naux1.Close<\/span><\/p>\n<p><b>**\u00a0Script to delete data from the file **<\/b><\/p>\n<p class=\"MsoNormal\" style=\"font-family: Courier New; color: #000000;\">Dim aux, aux1<\/p>\n<p class=\"MsoNormal\" style=\"font-family: Courier New; color: #000000;\">Set aux = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br \/>\nSet aux1 = aux.OpenTextFile(&#8220;C:\\Temp\\Test.txt&#8221;,2)<br \/>\naux1.Write &#8221; &#8221;<br \/>\naux1.Close<\/p>\n<p class=\"MsoNormal\"><b>** Script to delete the text file **<\/b><\/p>\n<p class=\"MsoNormal\" style=\"font-family: Courier New; color: #000000;\">Dim aux<\/p>\n<p class=\"MsoNormal\"><span style=\"font-family: Courier New; color: #000000;\">Set aux = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br \/>\naux.DeleteFile(&#8220;C:\\Temp\\Test.txt&#8221;)<\/span><\/p>\n<p><b>**\u00a0Script to read data from the TXT file and load it into InternalTag1 **<\/b><\/p>\n<p><span style=\"color: #000000; font-family: Courier New;\">Const ForReading = 1, ForWriting = 2<\/span><br style=\"color: #000000; font-family: Courier New;\" \/><span style=\"color: #000000; font-family: Courier New;\">Dim fso, f<\/span><br style=\"color: #000000; font-family: Courier New;\" \/><span style=\"color: #000000; font-family: Courier New;\">Set fso = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<\/span><br style=\"color: #000000; font-family: Courier New;\" \/><span style=\"color: #000000; font-family: Courier New;\">Set f = fso.OpenTextFile(&#8220;C:\\TEMP\\Test.txt&#8221;, ForReading)<\/span><br style=\"color: #000000; font-family: Courier New;\" \/><span style=\"color: #000000; font-family: Courier New;\">Application.GetObject(&#8220;Dados.InternalTag1&#8221;).Value = f.ReadAll<\/span><\/p>\n<p><span style=\"font-weight: bold;\">NOTE<\/span>: Attached to this article is a sample application demonstrating the methods seen above.<\/p>\n<h3>Attachments:<\/h3>\n<p><a href=\"\/wp-content\/uploads\/2019\/03\/Sample-15.zip\">Sample.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: How can I read\/write TXT files with E3? Solution: To do so, you must use the methods from FileSystemObject object. Examples: ** Script to create a TXT file **&hellip;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[763],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>KB-12658: Reading\/Writing TXT files with E3. - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"KB-12658: Reading\/Writing TXT files with E3.\" \/>\n<meta property=\"og:description\" content=\"Question: How can I read\/write TXT files with E3? Solution: To do so, you must use the methods from FileSystemObject object. Examples: ** Script to create a TXT file **&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:34:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-01-08T19:11:59+00:00\" \/>\n<meta name=\"author\" content=\"Pudi, Ricardo Meurer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pudi, Ricardo Meurer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/\"},\"author\":{\"name\":\"Pudi, Ricardo Meurer\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fc38afe6cfcf259f49288faf1f7e73e5\"},\"headline\":\"KB-12658: Reading\/Writing TXT files with E3.\",\"datePublished\":\"2019-03-25T20:34:02+00:00\",\"dateModified\":\"2020-01-08T19:11:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/\"},\"wordCount\":191,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/\",\"name\":\"[:pt]KB-12658: Reading\/Writing TXT files with E3.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:34:02+00:00\",\"dateModified\":\"2020-01-08T19:11:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"KB-12658: Reading\/Writing TXT files with E3.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fc38afe6cfcf259f49288faf1f7e73e5\",\"name\":\"Pudi, Ricardo Meurer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/902c3cf26668a366d92c08aa1c101cff?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/902c3cf26668a366d92c08aa1c101cff?s=96&d=mm&r=g\",\"caption\":\"Pudi, Ricardo Meurer\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/pudi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"KB-12658: Reading\/Writing TXT files with E3. - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]KB-12658: Reading\/Writing TXT files with E3.[:] - Elipse Knowledgebase","og_description":"Question: How can I read\/write TXT files with E3? Solution: To do so, you must use the methods from FileSystemObject object. Examples: ** Script to create a TXT file **&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:34:02+00:00","article_modified_time":"2020-01-08T19:11:59+00:00","author":"Pudi, Ricardo Meurer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Pudi, Ricardo Meurer","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/"},"author":{"name":"Pudi, Ricardo Meurer","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fc38afe6cfcf259f49288faf1f7e73e5"},"headline":"KB-12658: Reading\/Writing TXT files with E3.","datePublished":"2019-03-25T20:34:02+00:00","dateModified":"2020-01-08T19:11:59+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/"},"wordCount":191,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/","url":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/","name":"[:pt]KB-12658: Reading\/Writing TXT files with E3.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:34:02+00:00","dateModified":"2020-01-08T19:11:59+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/kb12658-readingwriting-txt-files-with-e3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"KB-12658: Reading\/Writing TXT files with E3."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/fc38afe6cfcf259f49288faf1f7e73e5","name":"Pudi, Ricardo Meurer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/902c3cf26668a366d92c08aa1c101cff?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/902c3cf26668a366d92c08aa1c101cff?s=96&d=mm&r=g","caption":"Pudi, Ricardo Meurer"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/pudi\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/1198"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=1198"}],"version-history":[{"count":2,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/1198\/revisions"}],"predecessor-version":[{"id":9733,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/1198\/revisions\/9733"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=1198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=1198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=1198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}