<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Replace First two lines of file with &lt;scenarioFile&gt;  (removing schema)' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Replace First two lines of file with &lt;scenarioFile&gt;  (removing schema)' posted on the 'MS-DOS' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 20:40:20 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 20:40:20 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Replace First two lines of file with &lt;scenarioFile&gt;  (removing schema)</title>
      <link>http://www.programmersheaven.com/mb/MS-DOS/428304/428304/replace-first-two-lines-of-file-with-scenariofile--removing-schema/</link>
      <description>I am having a bear of a time getting a batch file to delete the first two lines of every file and replace them with a file of the same name and “&amp;lt;scenarioFile&amp;gt;”&lt;br /&gt;
&lt;br /&gt;
So changing &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;&lt;br /&gt;
&amp;lt;scenarioFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;&lt;/strong&gt;       &lt;br /&gt;
          &amp;lt;updateRec&amp;gt;&lt;br /&gt;
               &amp;lt;ec&amp;gt;CME&amp;lt;/ec&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&amp;lt;scenarioFile&amp;gt;&lt;/strong&gt;&lt;br /&gt;
          &amp;lt;updateRec&amp;gt;&lt;br /&gt;
               &amp;lt;ec&amp;gt;CME&amp;lt;/ec&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since it is a batch file, you can show me how to do this to one file, and then I can copy paste the rest into the batch  (I hope that makes sense)&lt;br /&gt;
&lt;br /&gt;
The unwanted schema was added by Excel.&lt;br /&gt;
&lt;br /&gt;
Thank you for your help.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/MS-DOS/428304/428304/replace-first-two-lines-of-file-with-scenariofile--removing-schema/</guid>
      <pubDate>Mon, 16 Apr 2012 04:44:36 -0700</pubDate>
      <category>MS-DOS</category>
    </item>
    <item>
      <title>Replace First two lines of file with &lt;scenarioFile&gt;  (removing schema)</title>
      <link>http://www.programmersheaven.com/mb/MS-DOS/428304/428433/replace-first-two-lines-of-file-with-scenariofile--removing-schema/#428433</link>
      <description>make a batch file called changelines.cmd&lt;br /&gt;
@echo off&lt;br /&gt;
echo.&lt;br /&gt;
	for /f "tokens=1* delims= " %%a in (%1) do (&lt;br /&gt;
		if %%a==^&amp;lt;?xml echo. 2&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
		if %%a==^&amp;lt;scenarioFile echo ^&amp;lt;scenarioFile^&amp;gt; &amp;gt;&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
		if not %%a==^&amp;lt;?xml if not %%a==^&amp;lt;scenarioFile echo %%a%%b &amp;gt;&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
	)&lt;br /&gt;
copy /y %temp%\newfile.tmp %1 &amp;gt; nul&lt;br /&gt;
del %temp%\newfile.tmp&lt;br /&gt;
&lt;br /&gt;
now you can run this from the command prompt:&lt;br /&gt;
for %a in (*.ext) do changelines %a&lt;br /&gt;
&lt;br /&gt;
replace *.ext with the wildcard of your excel files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/MS-DOS/428304/428433/replace-first-two-lines-of-file-with-scenariofile--removing-schema/#428433</guid>
      <pubDate>Sun, 13 May 2012 15:44:46 -0700</pubDate>
      <category>MS-DOS</category>
    </item>
    <item>
      <title>Replace First two lines of file with &lt;scenarioFile&gt;  (removing schema)</title>
      <link>http://www.programmersheaven.com/mb/MS-DOS/428304/428434/replace-first-two-lines-of-file-with-scenariofile--removing-schema/#428434</link>
      <description>make a batch file called changelines.cmd&lt;br /&gt;
@echo off&lt;br /&gt;
echo.&lt;br /&gt;
	for /f "tokens=1* delims= " %%a in (%1) do (&lt;br /&gt;
		if %%a==^&amp;lt;?xml echo. 2&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
		if %%a==^&amp;lt;scenarioFile echo ^&amp;lt;scenarioFile^&amp;gt; &amp;gt;&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
		if not %%a==^&amp;lt;?xml if not %%a==^&amp;lt;scenarioFile echo %%a%%b &amp;gt;&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
	)&lt;br /&gt;
copy /y %temp%\newfile.tmp %1&lt;br /&gt;
del %temp%\newfile.tmp&lt;br /&gt;
&lt;br /&gt;
now from the command line, do this:&lt;br /&gt;
for %a in (*.ext) do changelines %a&lt;br /&gt;
&lt;br /&gt;
replace *.ext with the filename and type of your excel files.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/MS-DOS/428304/428434/replace-first-two-lines-of-file-with-scenariofile--removing-schema/#428434</guid>
      <pubDate>Sun, 13 May 2012 15:51:31 -0700</pubDate>
      <category>MS-DOS</category>
    </item>
    <item>
      <title>Replace First two lines of file with &lt;scenarioFile&gt;  (removing schema)</title>
      <link>http://www.programmersheaven.com/mb/MS-DOS/428304/428435/replace-first-two-lines-of-file-with-scenariofile--removing-schema/#428435</link>
      <description>make a batch file called changelines.cmd&lt;br /&gt;
@echo off&lt;br /&gt;
echo.&lt;br /&gt;
	for /f "tokens=1* delims= " %%a in (%1) do (&lt;br /&gt;
		if %%a==^&amp;lt;?xml echo. 2&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
		if %%a==^&amp;lt;scenarioFile echo ^&amp;lt;scenarioFile^&amp;gt; &amp;gt;&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
		if not %%a==^&amp;lt;?xml if not %%a==^&amp;lt;scenarioFile echo %%a%%b &amp;gt;&amp;gt;%temp%\newfile.tmp&lt;br /&gt;
	)&lt;br /&gt;
copy /y %temp%\newfile.tmp %1&lt;br /&gt;
del %temp%\newfile.tmp&lt;br /&gt;
&lt;br /&gt;
now from the command line, do this:&lt;br /&gt;
for %a in (*.ext) do changelines %a&lt;br /&gt;
&lt;br /&gt;
replace *.ext with the filename and type of your excel files.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/MS-DOS/428304/428435/replace-first-two-lines-of-file-with-scenariofile--removing-schema/#428435</guid>
      <pubDate>Sun, 13 May 2012 15:54:55 -0700</pubDate>
      <category>MS-DOS</category>
    </item>
  </channel>
</rss>