MS-DOS

Moderators: blip
Number of threads: 362
Number of posts: 872

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Replace First two lines of file with <scenarioFile> (removing schema) Posted by skorpio07 on 13 May 2012 at 3:51 PM
make a batch file called changelines.cmd
@echo off
echo.
for /f "tokens=1* delims= " %%a in (%1) do (
if %%a==^<?xml echo. 2>%temp%\newfile.tmp
if %%a==^<scenarioFile echo ^<scenarioFile^> >>%temp%\newfile.tmp
if not %%a==^<?xml if not %%a==^<scenarioFile echo %%a%%b >>%temp%\newfile.tmp
)
copy /y %temp%\newfile.tmp %1
del %temp%\newfile.tmp

now from the command line, do this:
for %a in (*.ext) do changelines %a

replace *.ext with the filename and type of your excel files.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.