-
January 12th, 2004, 04:13 PM
#1
Registered User
Familiar with DOS
I need a DOS batch file to run on a Windows 2000 machine that will allow the user to input the name of a file, and that user defined file will be appened to a header file, and the appended information will be put into a new file. Can anyone help? Thanks in advance.
-
January 14th, 2004, 11:44 AM
#2
Registered User
Well I suppose to could be possible as long as you run the batch file with the file name ie: a:\batchfile filename.txt then use the append command. I have dealt with batchfile processing in the past, been a while tho.
"We must always fear the wicked. But there is another kind of evil that we must fear the most, and that is the indifference of good men." -- Monsignor; The Boondock Saints.
-
January 14th, 2004, 12:31 PM
#3
Registered User
Been a long time since I rock an' roll
Originally Posted by Akuma
I need a DOS batch file to run on a Windows 2000 machine that will allow the user to input the name of a file, and that user defined file will be appened to a header file, and the appended information will be put into a new file. Can anyone help? Thanks in advance.
A good resource for this is : http://www.labmice.net/scripting/
Could not hit the curveball
-
January 14th, 2004, 11:36 PM
#4
Registered User
Try this DOS code in a batch file:
_____________________
@ECHO off
:: filname.bat
IF "%1"=="" ECHO. must enter existing filename
IF "%1"=="" GOTO end
IF not exist %1 ECHO. file "%1" does not exist
IF not exist %1 GOTO end
IF exist enter.bat ECHO. enter.bat in current directory
IF exist enter.bat GOTO end
PATH>%temp%.\respath.bat
PATH %temp%;%path%
DIR/A-D/B/L/-P %1. > %temp%.\filname1.dat
ECHO. >> %temp%.\filname1.dat
DATE <%temp%.\filname1.dat | find "):" > %temp%.\filname1.bat
ECHO set fnam=%%4> %temp%.\enter.bat
FOR %%C in (call del) do %%C %temp%.\filname1.bat
FOR %%F IN (%temp%.\filname1.dat %temp%.\enter.bat) do DEL %%F
FOR %%C in (call del) do %%C %temp%.\respath.bat
:end
copy header.txt+%1 final.txt
________________________
You will need a file called header.txt that contains the header info.
The user's filename must exist and the end result will be a file called final.txt that contains the appended data.
Hope this helps.
-
January 15th, 2004, 07:04 AM
#5
Geezer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks