<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Petri IT Knowledgebase Forums - DOS Command Shell</title>
		<link>http://www.petri.co.il/forums/</link>
		<description>For good old command line and batch file issues.</description>
		<language>en</language>
		<lastBuildDate>Sat, 18 May 2013 17:28:54 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.petri.co.il/forums/images/steelblue/misc/rss.jpg</url>
			<title>Petri IT Knowledgebase Forums - DOS Command Shell</title>
			<link>http://www.petri.co.il/forums/</link>
		</image>
		<item>
			<title>Read, parse, then write to a file</title>
			<link>http://www.petri.co.il/forums/showthread.php?t=63239&amp;goto=newpost</link>
			<pubDate>Thu, 18 Apr 2013 17:55:27 GMT</pubDate>
			<description><![CDATA[I have to need to read in a filename from each sub folder, find a string I am looking for, then write to a text file.  The filename from each sub folder is always the same. 
 
I use "find" to look for the string.  This is what I have... 
 
 
Code: 
--------- 
@ECHO OFF]]></description>
			<content:encoded><![CDATA[<div>I have to need to read in a filename from each sub folder, find a string I am looking for, then write to a text file.  The filename from each sub folder is always the same.<br />
<br />
I use &quot;find&quot; to look for the string.  This is what I have...<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">@ECHO OFF<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
SET filename=metadata.txt<br />
<br />
FOR /F %%D in ('dir /b /a:D') DO (<br />
<br />
(find /i &quot;&lt;artist_name&gt;&quot; &quot;%%D\%filename%&quot;)<br />
(find /i &quot;&lt;title&gt;&quot; &quot;%%D\%filename%&quot;)<br />
(find /i &quot;&lt;track_number&gt;&quot; &quot;%%D\%filename%&quot;)<br />
<br />
)</code><hr />
</div>How do I assign variables for &quot;artist_name&quot;, &quot;title&quot;, and &quot;track_number&quot;, then echo/print each variable to a file so that the result looks like<br />
<br />
artist_name, title, track_number (comma delimited, for example)<br />
<br />
Thanks in advance!</div>

]]></content:encoded>
			<category domain="http://www.petri.co.il/forums/forumdisplay.php?f=68">DOS Command Shell</category>
			<dc:creator>graffixx</dc:creator>
			<guid isPermaLink="true">http://www.petri.co.il/forums/showthread.php?t=63239</guid>
		</item>
		<item>
			<title>DOS Batch file to pull certain info from a text file</title>
			<link>http://www.petri.co.il/forums/showthread.php?t=63091&amp;goto=newpost</link>
			<pubDate>Thu, 04 Apr 2013 19:33:08 GMT</pubDate>
			<description><![CDATA[Guys, 
 
I'm having trouble getting a dos batch file to work correctly to pull only certain lines from a text document.  I need it to read through a .txt file and copy the lines that have an O (oh) in the 14th field and a three character value in the 19th comma delimited field to a blank txt...]]></description>
			<content:encoded><![CDATA[<div>Guys,<br />
<br />
I'm having trouble getting a dos batch file to work correctly to pull only certain lines from a text document.  I need it to read through a .txt file and copy the lines that have an O (oh) in the 14th field and a three character value in the 19th comma delimited field to a blank txt document.  Example text is below.  I appreciate any help I can get with this.<br />
<br />
<br />
&quot;111111&quot;,&quot;02&quot;,&quot;111476&quot;,&quot;Customer1&quot;,&quot;xxS48&quot;,&quot;001535  32601&quot;,&quot;111210&quot;,&quot;101110&quot;,&quot;1740.00&quot;,&quot;.00&quot;,&quot;011513&quot;,  &quot;P&quot;,2013-03-28 13:20,&quot;S&quot;,&quot;&quot;,&quot;&quot;,&quot;044LP&quot;,&quot;111476&quot;,&quot;LAK&quot;<br />
<br />
&quot;222222&quot;,&quot;02&quot;,&quot;111089&quot;,&quot;Customer2&quot;,&quot;xx2584&quot;,&quot;00153  270702&quot;,&quot;111610&quot;,&quot;081110&quot;,&quot;540.10&quot;,&quot;.00&quot;,&quot;092712&quot;,  &quot;P&quot;,2013-03-27 10:33,&quot;O&quot;,&quot;&quot;,&quot;&quot;,&quot;044LP&quot;,&quot;111089&quot;,&quot;LAK&quot;</div>

]]></content:encoded>
			<category domain="http://www.petri.co.il/forums/forumdisplay.php?f=68">DOS Command Shell</category>
			<dc:creator>dspencer5</dc:creator>
			<guid isPermaLink="true">http://www.petri.co.il/forums/showthread.php?t=63091</guid>
		</item>
		<item>
			<title>Need to delete files from sub folders but not from the root</title>
			<link>http://www.petri.co.il/forums/showthread.php?t=62623&amp;goto=newpost</link>
			<pubDate>Tue, 05 Feb 2013 23:23:07 GMT</pubDate>
			<description><![CDATA[Hi Folks, 
I've been requested by the powers that be to find away to clean up some files left by one of our software suites. 
 
So the scenario is: 
I have a folder 
This folder has a bunch of important files in it 
Within the folder are a number of sub folders 
Within these sub folders are a bunch...]]></description>
			<content:encoded><![CDATA[<div>Hi Folks,<br />
I've been requested by the powers that be to find away to clean up some files left by one of our software suites.<br />
<br />
So the scenario is:<br />
I have a folder<br />
This folder has a bunch of important files in it<br />
Within the folder are a number of sub folders<br />
Within these sub folders are a bunch of temp files that are not important.<br />
<br />
So I need to be able to remove all files within the sub folders but leave the files in the root of that folder intact.<br />
The sub folders don't need to be deleted either, they can stay put.<br />
<br />
So I was looking at something similar to:<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">del /S /Q /F &quot;C:\folder&quot;</code><hr />
</div>But I know that this would remove the files in the root of the folder.<br />
I thought this might have been a good way to go<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">del /S /Q /F &quot;C:\folder\*\*&quot;</code><hr />
</div>But del doesn't seem to like wildcards for directories.<br />
Same applies with robocopy. I thought I might be able to robocopy the files to a temp folder and then run the first del command above but I just got a parameter error.<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">robocopy &quot;C:\Users\tlane\Desktop\New folder&quot; &quot;C:\Users\tlane\Desktop\newfolderpurge&quot; /S /MOV /XF &quot;C:\Users\tlane\Desktop\New folder&quot; /R:1 /W:1</code><hr />
</div>or<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">robocopy &quot;C:\Users\tlane\Desktop\New folder\*\*&quot; &quot;C:\Users\tlane\Desktop\newfolderpurge&quot; /S /MOV /R:1 /W:1</code><hr />
</div>So that's about the extent of my ability to code.<br />
If someone has a better suggestion I'd be appreciative.<br />
<br />
If needed this could also be a vbscript if that works better.<br />
Appreciate the help.<br />
<br />
Trent</div>

]]></content:encoded>
			<category domain="http://www.petri.co.il/forums/forumdisplay.php?f=68">DOS Command Shell</category>
			<dc:creator>Trentl</dc:creator>
			<guid isPermaLink="true">http://www.petri.co.il/forums/showthread.php?t=62623</guid>
		</item>
		<item>
			<title>Please help with code</title>
			<link>http://www.petri.co.il/forums/showthread.php?t=62604&amp;goto=newpost</link>
			<pubDate>Sun, 03 Feb 2013 21:26:41 GMT</pubDate>
			<description><![CDATA[If someone could please help me with batch script code to do the following I'd appreciate it. 
 
I have a comma delimited text file called "stats_record.txt"  that contains about 10,000 lines  
each line is in the following format with different values for each field in each  line. 
 ...]]></description>
			<content:encoded><![CDATA[<div><font size="5"><font face="Arial Black">If someone could please <font size="5">help me with batch script code</font></font></font> <font size="5">to do the following I'd appreciate it.</font><br />
<br />
I have a comma delimited text file called &quot;stats_record.txt&quot;  that contains about 10,000 lines <br />
each line is in the following format with different values for each field in each  line.<br />
 <br />
01a,3,2,2,12,13,02,08,11<br />
<br />
I need to be able to read the file and place the 9 fields into variables in a batch file  i want to call the variables field1 thru field 9 and then output a new text file called &quot;stats_out.txt&quot; which will create the same number of lines but will assign the fields to peoples names<br />
<br />
Each line will have a name associated with each field and that name along with the field will be written to the out put file<br />
<br />
<br />
So the first output record will look like  this<br />
<br />
<br />
Mary 01a,Bob 3,Charlie 2,Tina 2 ,Rachel 12,Jose 13,Louis 2,Don 8,Paul 11. <br />
<br />
in the records that follow, Mary will always be assigned to the values in field 1, bob field 2 Charlie field 3 etc.<br />
<br />
Thanks a lot in advance :)<br />
Ed</div>

]]></content:encoded>
			<category domain="http://www.petri.co.il/forums/forumdisplay.php?f=68">DOS Command Shell</category>
			<dc:creator>edwite777</dc:creator>
			<guid isPermaLink="true">http://www.petri.co.il/forums/showthread.php?t=62604</guid>
		</item>
	</channel>
</rss>
