From Jeff Earle@1:229/700 to All on Sun Mar 2 11:20:12 2025
Hello all.
I need some help for a batch file that will test for specific text as the last line of a .ans and .asc file and if the text is not there, it needs to add it.
I've been playing around with it and think I have the right code but I'm not sure if it's got the right logic.
This is what I have so far. I've replaced specific path and file names with [stuff] or (stuff) and the specific text to find is "|PA":
@echo off
c:
cd \[path to the batch file]
:ASC
for /f "tokens=*" %%a in (file.asc) do set "line=%%a"
echo "%line%"|findstr /i /c:"|PA" >nul
if errorlevel 1 (
echo ^|PA>>file.asc
) else (
goto ANS
)
:ANS
for /f "tokens=*" %%a in (file.ans) do set "line=%%a"
echo "%line%|findstr /i /c:"|PA" >nul
if errorlevel 1 (
echo ^|PA>>file.ans
) else (
goto END
)
:END
Is there anythimg I need to modify, add or remove to ensure the logic and actions are correct?
Any help would be appreciated.
Thanks
(I hope it displays properly with the pipe codes in this message!)
... There will be a rain dance Friday night, weather permitting!
--- Mystic BBS v1.12 A48 (Windows/64)
* Origin: Mystic Realms - A Social Media Alternative (1:229/700)
Who's Online
Recent Visitors
Deepend
Sun May 11 12:44:18 2025
from
Calgary, Ab
via
HTTPS
Dextile
Sat May 10 23:51:47 2025
from
Calgary, Ab
via
Telnet
Vintagegeek
Sat May 10 15:24:01 2025
from
Swarthmore, Pa
via
Telnet
Dextile
Sat May 10 06:11:23 2025
from
Calgary, Ab
via
Telnet
System Info
Sysop:
deepend
Location:
Calgary, Alberta
Users:
266
Nodes:
10 (0
/
10)
Uptime:
16:45:50
Calls:
2,088
Files:
4,444
D/L today:
35 files
(13,453K bytes)
Messages:
412,791
Synchronet Oneliners
Vintagegeek@rdbbs Wed Apr 2 05:31:46 2025 AcornTV
Vintagegeek@rdbbs Mon Apr 7 15:00:43 2025 Britbox
Vintagegeek@rdbbs Tue Apr 29 06:11:59 2025 My life is Murder TV
Vintagegeek@rdbbs Sat May 3 05:08:46 2025 Go Stampede
Darknetgirl@rdbbs Tue May 6 02:09:48 2025 Greetings from London/Milan. Getting back to real stuff