{"id":81,"date":"2012-02-23T07:06:47","date_gmt":"2012-02-23T13:06:47","guid":{"rendered":"https:\/\/www.asberry.org\/blog_tech\/?p=81"},"modified":"2012-02-23T07:11:30","modified_gmt":"2012-02-23T13:11:30","slug":"checking-a-file-for-content","status":"publish","type":"post","link":"https:\/\/asberry.org\/blog_tech\/?p=81","title":{"rendered":"Checking a file for content in Visual Basic"},"content":{"rendered":"<pre class=\"brush: vb; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\nImports System\r\n Imports System.Data\r\n Imports System.Math\r\n Imports Microsoft.SqlServer.Dts.Runtime\r\n Imports System.IO\r\n\r\n&lt;System.AddIn.AddIn(&quot;ScriptMain&quot;, Version:=&quot;1.0&quot;, Publisher:=&quot;&quot;, Description:=&quot;&quot;)&gt; _\r\n &lt;System.CLSCompliantAttribute(False)&gt; _\r\n Partial Public Class ScriptMain\r\n Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase\r\n\r\nEnum ScriptResults\r\n Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success\r\n Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure\r\n End Enum\r\n\r\nPublic Sub Main()\r\n Dim oReader As StreamReader\r\n Dim intLines As Integer\r\n Dim strLines As String\r\n\r\nDts.TaskResult = ScriptResults.Success\r\n intLines = 0\r\n strLines = &quot;&quot;\r\n oReader = New StreamReader(&quot;C:\\Taleo\\TCC\\Prod\\Export\\Requisition\\Requisition.csv&quot;)\r\n Do While Not oReader.EndOfStream\r\n strLines = oReader.ReadLine()\r\n intLines = intLines + 1\r\n Loop\r\n oReader.Close()\r\n oReader = Nothing\r\n If intLines &lt; 2 Then\r\n File.Delete(&quot;C:\\Taleo\\TCC\\Prod\\Export\\Requisition\\Requisition.csv&quot;)\r\n Dts.TaskResult = ScriptResults.Failure\r\n\r\nEnd If\r\n\r\nEnd Sub\r\n\r\nEnd Class\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Imports System.IO &lt;System.AddIn.AddIn(&quot;ScriptMain&quot;, Version:=&quot;1.0&quot;, Publisher:=&quot;&quot;, Description:=&quot;&quot;)&gt; _ &lt;System.CLSCompliantAttribute(False)&gt; _ Partial Public Class ScriptMain Inherits Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase Enum ScriptResults Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure End Enum Public Sub Main() Dim oReader As StreamReader Dim intLines As Integer Dim strLines As String Dts.TaskResult = ScriptResults.Success intLines = 0 strLines [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[9],"tags":[],"class_list":["post-81","post","type-post","status-publish","format-standard","hentry","category-visual-basic","author-aron"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4bBkH-1j","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=81"}],"version-history":[{"count":4,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/81\/revisions"}],"predecessor-version":[{"id":87,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/81\/revisions\/87"}],"wp:attachment":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}