<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How Can I Query a Text File and Retrieve Records That Occurred on a Specific Date?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/05/04/how-can-i-query-a-text-file-and-retrieve-records-that-occurred-on-a-specific-date.aspx</link><description>Hey, Scripting Guy! We have tons of text files in which each line in the file represents a record or an event of some kind. How can I use a script to retrieve records or events that occurred on a specified date? -- TW 
 Hey, TW. You know, in your email</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: How Can I Query a Text File and Retrieve Records That Occurred on a Specific Date?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/05/04/how-can-i-query-a-text-file-and-retrieve-records-that-occurred-on-a-specific-date.aspx#3483032</link><pubDate>Fri, 24 Feb 2012 16:22:41 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3483032</guid><dc:creator>RKD</dc:creator><description>&lt;p&gt;I modified the script a little bit to fit my situation and am getting an error from JET DB engine on the &amp;quot;objRecordset.Open&amp;quot; line: &amp;quot;no value given for one or more required parameters&amp;quot;. &amp;nbsp;Can someone help please?&lt;/p&gt;
&lt;p&gt;Sub queryTXT(strNodeName)&lt;/p&gt;
&lt;p&gt;Const adOpenStatic = 3&lt;/p&gt;
&lt;p&gt;Const adLockOptimistic = 3&lt;/p&gt;
&lt;p&gt;Const adCmdText = &amp;amp;H0001&lt;/p&gt;
&lt;p&gt;Set objConnection = CreateObject(&amp;quot;ADODB.Connection&amp;quot;)&lt;/p&gt;
&lt;p&gt;Set objRecordSet = CreateObject(&amp;quot;ADODB.Recordset&amp;quot;)&lt;/p&gt;
&lt;p&gt;strTargetLoc = &amp;quot;C:\scripts\queryTXT&amp;quot;&lt;/p&gt;
&lt;p&gt;objConnection.Open &amp;quot;Provider=Microsoft.Jet.OLEDB.4.0;&amp;quot; &amp;amp; _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;quot;Data Source=&amp;quot; &amp;amp; strTargetLoc &amp;amp; &amp;quot;;&amp;quot; &amp;amp; &amp;quot;Extended Properties=&amp;quot;&amp;quot;text;HDR=YES;FMT=Delimited&amp;quot;&amp;quot;&amp;quot;&lt;/p&gt;
&lt;p&gt;strTargetFile = &amp;quot;TSMClientsStatus.csv&amp;quot;&lt;/p&gt;
&lt;p&gt;strSQL = &amp;quot;Select * FROM &amp;quot; &amp;amp; strTargetFile &amp;amp; &amp;quot; where NODE_NAME = &amp;quot; &amp;amp; strNodeName&lt;/p&gt;
&lt;p&gt;objRecordset.Open strSQL, objConnection, adOpenStatic, adLockOptimistic, adCmdText&lt;/p&gt;
&lt;p&gt;Do Until objRecordset.EOF&lt;/p&gt;
&lt;p&gt;Wscript.Echo objRecordset.Fields.Item(&amp;quot;NODE_NAME&amp;quot; &amp;amp; &amp;quot; &amp;quot; &amp;amp; &amp;quot;TCP_ADDRESS&amp;quot;)&lt;/p&gt;
&lt;p&gt;Loop&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;arkady.me@gmail.com&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3483032" width="1" height="1"&gt;</description></item><item><title>re: How Can I Query a Text File and Retrieve Records That Occurred on a Specific Date?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/05/04/how-can-i-query-a-text-file-and-retrieve-records-that-occurred-on-a-specific-date.aspx#3292637</link><pubDate>Tue, 10 Nov 2009 02:06:20 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3292637</guid><dc:creator>solrepr</dc:creator><description>&lt;p&gt;At the risk of self promoting, my company makes a program that would solve that exact problem, although currently it can't be automated. &amp;nbsp;Using the program File Query, you could open up any fixed or delimited file, and write a simple query against it without any boiler plate code, and templates for most queries are included. &amp;nbsp;Here is how you would get that information with the program.&lt;/p&gt;
&lt;p&gt;var query = (&lt;/p&gt;
&lt;p&gt; &amp;nbsp;from line in inputFile&lt;/p&gt;
&lt;p&gt; &amp;nbsp;where line[&amp;quot;HIREDATE&amp;quot;] == &amp;quot;3/1/2006&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;select line&lt;/p&gt;
&lt;p&gt;);&lt;/p&gt;
&lt;p&gt;For each line in the input file where HireDate equals &amp;quot;3/1/2006&amp;quot;, it would select the entire line. &amp;nbsp;If the query looks similar, it's because it uses LINQ internally for the query. &amp;nbsp;For more information, check out www.agiledatasoftware.com/products.html.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3292637" width="1" height="1"&gt;</description></item></channel></rss>