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
Fri Nov 20 00:13:31 2026
from
Calgary, Ab
via
HTTPS
Vintagegeek
Thu Nov 19 11:14:40 2026
from
Swarthmore, Pa
via
Telnet
Vintagegeek
Tue Nov 17 06:51:08 2026
from
Swarthmore, Pa
via
Telnet
Vintagegeek
Mon Nov 16 15:18:32 2026
from
Swarthmore, Pa
via
Telnet
System Info
Sysop:
deepend
Location:
Calgary, Alberta
Users:
326
Nodes:
10 (0
/
10)
Uptime:
84:22:14
Calls:
2,755
Files:
6,698
D/L today:
14 files
(10,291K bytes)
Messages:
498,097
Synchronet Oneliners
Dundee@rdbbs Mon Oct 19 16:38:50 2026 The Dude abides...
Vintagegeek@rdbbs Sun Nov 1 13:54:14 2026 November is here
Vintagegeek@rdbbs Fri Nov 6 11:28:18 2026 His r Hers Golf Clubs
Vintagegeek@rdbbs Sun Nov 15 08:19:35 2026 back online
Vintagegeek@rdbbs Mon Nov 16 15:18:25 2026 picit0
Vintagegeek@rdbbs Tue Nov 17 06:50:40 2026 MegaSlots and Lemonade