From: zeljko.kucko@hmu.hr   
      
   "Tom Lavedas" wrote in message   
   news:dcfb5778-c4a2-4491-9649-724cf254fdb5@googlegroups.com...   
   > On Tuesday, December 18, 2012 9:50:22 AM UTC-5, Zac wrote:   
   >> Hello, I need help and solution for the following situtation.   
   >>   
   >> I have two files: source.txt and output.txt   
   >> Source.txt file has two lines.   
   >>   
   >> I need a batch file that does the following:   
   >> - Asks the user to enter a number   
   >> - Copies the second line from the source.txt file in the output.txt file   
   >> as many times as the value entered (each time creating a new row)   
   >> - on starting up again does the same thing so that adds a lines below   
   >> the existing ones If anyone can help I would be grateful.   
   >   
   > Maybe something like this will do what you want ...   
   >   
   > @echo off   
   > if [%1]==[] %0 source.txt output.txt   
   > if [%2]==[] %0 %1 output.txt   
   > setlocal & set numb=>> %2   
   > set /p numb=Enter a number:   
   > if not defined numb exit /b 1   
   > for /f "skip=1 delims=" %%L in (   
   > %1) do echo/%%L > %temp%\_T_ & goto :Next   
   > :Next   
   > for /l %%N in (1,1,%numb%) do copy /b %2 + %temp%\_T_ > nul   
   > del %temp%\_T_   
   > __________________________   
   > Tom Lavedas   
      
   It works perfectly!!!   
   Thank you very much.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|