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
Denn
Sat Feb 7 14:18:08 2026
from
Clearfield, Utah
via
Telnet
Guest
Sat Feb 7 08:23:44 2026
from
Sh
via
Telnet
Guest
Fri Feb 6 01:41:02 2026
from
Sh
via
Raw
Deepend
Thu Feb 5 15:57:55 2026
from
Calgary, Ab
via
HTTPS
System Info
Sysop:
deepend
Location:
Calgary, Alberta
Users:
293
Nodes:
10 (0
/
10)
Uptime:
161:08:48
Calls:
2,485
Calls today:
2
Files:
5,523
D/L today:
52 files
(11,371K bytes)
Messages:
454,726
Synchronet Oneliners
Ben Cartwright@rdbbs Mon Dec 29 08:15:35 2025 Hi!
Vintagegeek@rdbbs Fri Jan 2 13:31:40 2026 H A P P Y NEW YEAR
Guest@rdbbs Sat Jan 10 10:41:07 2026 Greetings Programs
Vintagegeek@rdbbs Tue Jan 13 13:09:57 2026 Look At That Moon
Deepend@rdbbs Mon Jan 26 00:12:58 2026 I'd have to go outside.. lol
Denn@rdbbs Sat Feb 7 14:17:58 2026 I'm suprised you didn't hook your wall up as interBBS.