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
Vintagegeek
Tue Nov 3 17:15:19 2026
from
Swarthmore, Pa
via
Telnet
Guest
Tue Nov 3 12:33:58 2026
from
Salina Ks
via
Telnet
Vintagegeek
Tue Nov 3 10:55:21 2026
from
Swarthmore, Pa
via
Telnet
Dustman
Tue Nov 3 08:12:54 2026
from
Illinois, United States
via
SSH
System Info
Sysop:
deepend
Location:
Calgary, Alberta
Users:
326
Nodes:
10 (0
/
10)
Uptime:
189:38:48
Calls:
2,740
Calls today:
4
Files:
6,636
D/L today:
82 files
(27,407K bytes)
Messages:
495,422
Synchronet Oneliners
Deepend@rdbbs Sun Oct 4 17:18:14 2026 upgraded BBS to current synchronet version
User Fx@rdbbs Sun Oct 4 21:01:03 2026 idek. thank you, from hashnix.club peace. ~ufx
Dustman@rdbbs Wed Oct 7 11:32:39 2026 Howdy all :)
Vintagegeek@rdbbs Wed Oct 14 10:53:35 2026 The Price is Wrong Now
Dundee@rdbbs Mon Oct 19 16:38:50 2026 The Dude abides...
Vintagegeek@rdbbs Sun Nov 1 13:54:14 2026 November is here