Saved Bookmarks
| 1. |
Solve : How to make a DOS program take an input file? |
|
Answer» HELLO, I have a program in DOS that takes manual entries from the command prompt. The DOS program then writes the output to a notepad file called output.txt I have over 17,000 entries I need to perform and would like to automate this TASK. I have the 17,000 entries in a notepad file called input.txt How do I feed this notepad file into the DOS program? PROVIDE more details, post the SCRIPT that you are currently using. From a Command Prompt enter: Code: [Select]for /? for more details. Quote from: smiso24 on April 07, 2010, 08:39:02 AM writes the output to a notepad file called output.txt C:\batch>type smi.bat Code: [Select]echo off echo. > output.txt for /f "DELIMS=" %%a in (input.txt) do ( echo %%a echo %%a >> output.txt ) echo type output.txt type output.txt | more Output: C:\batch> smi.bat The DOS program then writes The DOS program then writes The DOS program then writes The DOS program then writes type output.txt The DOS program then writes The DOS program then writes The DOS program then writes The DOS program then writes C:\batch> Quote from: smiso24 on April 07, 2010, 08:39:02 AM writes the output to a notepad file called output.txt I have over 17,000 entries I need to perform and would like to automate this task. I C:\batch>type simso.bat Code: [Select]echo off copy input.txt output.txt rem or type input.txt > output.txt rem for second run type input.txt >> output.txtC:\batch> |
|