 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to extract key phrases from a log file using a batch file.</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/</link>
	<description></description>
	<lastBuildDate>Sun, 19 May 2013 03:14:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75101</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Mon, 22 Mar 2010 21:25:18 +0000</pubDate>
		<guid isPermaLink="false">#comment-75101</guid>
		<description><![CDATA[&lt;a href=&quot;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx?mfr=true&quot;&gt;Find&lt;/a&gt; is a command line tool.  If you want to see its results, you have to run it from a &lt;a href=&quot;http://www.pcstats.com/articleview.cfm?articleid=1723&amp;page=2&quot;&gt;command prompt&lt;/a&gt;.

This is very basic.  I would recommend to look for resources to learn the basics, as you will most likely have to deal with this kind of things in the future.

Google is your friend ;)

Good luck.]]></description>
		<content:encoded><![CDATA[<p><a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/find.mspx?mfr=true">Find</a> is a command line tool.  If you want to see its results, you have to run it from a <a href="http://www.pcstats.com/articleview.cfm?articleid=1723&amp;page=2">command prompt</a>.</p>
<p>This is very basic.  I would recommend to look for resources to learn the basics, as you will most likely have to deal with this kind of things in the future.</p>
<p>Google is your friend <img src='http://itknowledgeexchange.techtarget.com/itanswers/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Good luck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stretch21</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75099</link>
		<dc:creator>stretch21</dc:creator>
		<pubDate>Mon, 22 Mar 2010 20:37:32 +0000</pubDate>
		<guid isPermaLink="false">#comment-75099</guid>
		<description><![CDATA[I&#039;m not sure you understand.  Now when I enter find /?, it flashes but nothing happens.  When I run the bach file, it creates a text file but nothing is in it.  I&#039;m so confused.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure you understand.  Now when I enter find /?, it flashes but nothing happens.  When I run the bach file, it creates a text file but nothing is in it.  I&#8217;m so confused.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75097</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Mon, 22 Mar 2010 20:28:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-75097</guid>
		<description><![CDATA[&quot;&lt;b&gt;&lt;i&gt;don’t I have to put in the location of where the log file is ?&lt;/i&gt;&lt;/b&gt;&quot;

I guess you can try, and find the answer.

From the command prompt, type this to get more help.

&lt;pre&gt;find /?&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>&#8220;<b><i>don’t I have to put in the location of where the log file is ?</i></b>&#8221;</p>
<p>I guess you can try, and find the answer.</p>
<p>From the command prompt, type this to get more help.</p>
<pre>find /?</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: stretch21</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75093</link>
		<dc:creator>stretch21</dc:creator>
		<pubDate>Mon, 22 Mar 2010 19:49:21 +0000</pubDate>
		<guid isPermaLink="false">#comment-75093</guid>
		<description><![CDATA[Ok great.but now don&#039;t I have to put in the location of where the log file is ?  Because when I lrun this batch file, it comes up as a blank text.]]></description>
		<content:encoded><![CDATA[<p>Ok great.but now don&#8217;t I have to put in the location of where the log file is ?  Because when I lrun this batch file, it comes up as a blank text.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chippy088</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75088</link>
		<dc:creator>chippy088</dc:creator>
		<pubDate>Mon, 22 Mar 2010 18:57:48 +0000</pubDate>
		<guid isPermaLink="false">#comment-75088</guid>
		<description><![CDATA[Can&#039;t add much more to this, you guys have it is pretty well covered.

However Stretch21, you did say &#039;phrases&#039; so if you have several queries to do on the same text file, but with different words to find, then a batch file will do it better. However you will have to call the batch file with the word/phrase wanted each time. 

If you want to put all the results into the same file, then I&#039;d suggest creating a batch file with either of the lines that Carlosdl or BobBeechey gave you, changed slightly.

Where the line has a single &gt; in it, change it to &gt;&gt;

This tells DOS to append each search to the file. A single &gt; means DOS will overwrite the previous contents of the file with the current search result.

For example (using Carlosdl&#039;s line   -     find /n /i %1 %2 &gt; %3)
You could replace %3 with a permanent results file, including a path if wanted, and you would always know to which file the search result was writen. and if you used the same parametersvariables for the search each time, the calling method would be simpler as you would have less typing to do. Only 3 parameters needed.

batchfile, text to find, which file to search.

I&#039;ve used a batch file this way for searching a series of installation, error or logs for text, for searching all log files I use  *.log as the file to search parameter. Saves typing if you are a sysadmin looking for the same text in a series of files.

Hope I haven&#039;t confused the issue. There are great tutorials on the web if you want to delve into batch files further.]]></description>
		<content:encoded><![CDATA[<p>Can&#8217;t add much more to this, you guys have it is pretty well covered.</p>
<p>However Stretch21, you did say &#8216;phrases&#8217; so if you have several queries to do on the same text file, but with different words to find, then a batch file will do it better. However you will have to call the batch file with the word/phrase wanted each time. </p>
<p>If you want to put all the results into the same file, then I&#8217;d suggest creating a batch file with either of the lines that Carlosdl or BobBeechey gave you, changed slightly.</p>
<p>Where the line has a single &gt; in it, change it to &gt;&gt;</p>
<p>This tells DOS to append each search to the file. A single &gt; means DOS will overwrite the previous contents of the file with the current search result.</p>
<p>For example (using Carlosdl&#8217;s line   &#8211;     find /n /i %1 %2 &gt; %3)<br />
You could replace %3 with a permanent results file, including a path if wanted, and you would always know to which file the search result was writen. and if you used the same parametersvariables for the search each time, the calling method would be simpler as you would have less typing to do. Only 3 parameters needed.</p>
<p>batchfile, text to find, which file to search.</p>
<p>I&#8217;ve used a batch file this way for searching a series of installation, error or logs for text, for searching all log files I use  *.log as the file to search parameter. Saves typing if you are a sysadmin looking for the same text in a series of files.</p>
<p>Hope I haven&#8217;t confused the issue. There are great tutorials on the web if you want to delve into batch files further.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75082</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Mon, 22 Mar 2010 18:10:45 +0000</pubDate>
		<guid isPermaLink="false">#comment-75082</guid>
		<description><![CDATA[&lt;pre&gt;find /n /i &quot;service&quot; status.log &gt; results.txt&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<pre>find /n /i "service" status.log &gt; results.txt</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: stretch21</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75048</link>
		<dc:creator>stretch21</dc:creator>
		<pubDate>Sun, 21 Mar 2010 20:07:54 +0000</pubDate>
		<guid isPermaLink="false">#comment-75048</guid>
		<description><![CDATA[Ok I&#039;m still not sure.....Let say I have a log........let&#039;s call it status.log.  and I need to pull a word like &quot;service&quot; from this log, how would I do this?]]></description>
		<content:encoded><![CDATA[<p>Ok I&#8217;m still not sure&#8230;..Let say I have a log&#8230;&#8230;..let&#8217;s call it status.log.  and I need to pull a word like &#8220;service&#8221; from this log, how would I do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75028</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Fri, 19 Mar 2010 18:27:45 +0000</pubDate>
		<guid isPermaLink="false">#comment-75028</guid>
		<description><![CDATA[In the example provided logstrip.txt is the resultant file containing the lines where &quot;text required&quot; was found.

You would have to create a new file, put the find command in it (with all its parameters as shown in the example above), and save it as a BAT file.

You could parameterize your bat script.  For example, you could use the find command this way:

&lt;pre&gt;find /n /i %1 %2 &gt; %3&lt;/pre&gt;

Then, when you execute this bat, you would have to send the appropriate parameters.

For example, assuming that you name your bat file &quot;test.bat&quot; and you want to obtain the same results as the original example, then you would execute your bat file this way:

&lt;pre&gt;test &quot;text required&quot; yourlog.log logstrip.txt&lt;/pre&gt;

But it really doesn&#039;t make much sense to me creating a bat script to execute just one command.]]></description>
		<content:encoded><![CDATA[<p>In the example provided logstrip.txt is the resultant file containing the lines where &#8220;text required&#8221; was found.</p>
<p>You would have to create a new file, put the find command in it (with all its parameters as shown in the example above), and save it as a BAT file.</p>
<p>You could parameterize your bat script.  For example, you could use the find command this way:</p>
<pre>find /n /i %1 %2 &gt; %3</pre>
<p>Then, when you execute this bat, you would have to send the appropriate parameters.</p>
<p>For example, assuming that you name your bat file &#8220;test.bat&#8221; and you want to obtain the same results as the original example, then you would execute your bat file this way:</p>
<pre>test "text required" yourlog.log logstrip.txt</pre>
<p>But it really doesn&#8217;t make much sense to me creating a bat script to execute just one command.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stretch21</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75025</link>
		<dc:creator>stretch21</dc:creator>
		<pubDate>Fri, 19 Mar 2010 16:23:08 +0000</pubDate>
		<guid isPermaLink="false">#comment-75025</guid>
		<description><![CDATA[But like I said, Iam new to this. The logstrip.txt”-do I create it and save it as a bat file ?  The I run it on the PC?]]></description>
		<content:encoded><![CDATA[<p>But like I said, Iam new to this. The logstrip.txt”-do I create it and save it as a bat file ?  The I run it on the PC?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stretch21</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/how-to-extract-key-phrases-from-a-log-file-using-a-batch-file/#comment-75024</link>
		<dc:creator>stretch21</dc:creator>
		<pubDate>Fri, 19 Mar 2010 16:21:33 +0000</pubDate>
		<guid isPermaLink="false">#comment-75024</guid>
		<description><![CDATA[Great.]]></description>
		<content:encoded><![CDATA[<p>Great.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/8 queries in 0.044 seconds using memcached
Object Caching 399/400 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-19 16:52:35 -->