Computing.Net > Forums > Programming > making prog (place file1 file2)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

making prog (place file1 file2)

Reply to Message Icon

Name: bulleke
Date: April 10, 2005 at 03:32:52 Pacific
OS: Windows XP
CPU/Ram: 128 MB
Comment:

How can you call a batch-file by typing
test.bat file1.txt file2.txt
--
set Count=0
for /f "tokens=*" %%a in (file1.txt) do call :Newfile %%a
exit /b
:Newfile file2.txt
set /a Count%%=2
echo %* >> file2.txt
if %count%==0 echo test >> file2.txt
exit /b
--



Sponsored Link
Ads by Google

Response Number 1
Name: FishMonger
Date: April 10, 2005 at 10:02:28 Pacific
Reply:

set Count=0
for /f "tokens=*" %%a in (%1%) do call :Newfile %%a
exit /b
:Newfile file2.txt
set /a Count%%=2
echo %* >> file2.txt
if %count%==0 echo test >> %2%
exit /b


0

Response Number 2
Name: FishMonger
Date: April 10, 2005 at 10:04:46 Pacific
Reply:

Oops, I forgot to fix each of the vars.

Replace each file1.txt with %1%
Replace each file2.txt with %2%


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: making prog (place file1 file2)

VB9 filestream www.computing.net/answers/programming/vb9-filestream/16776.html

Program to rename tons of files? www.computing.net/answers/programming/program-to-rename-tons-of-files/11667.html

Find string inside a variable,batch www.computing.net/answers/programming/find-string-inside-a-variablebatch/12011.html