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
Fri Sep 12 05:39:30 2025
from
Swarthmore, Pa
via
Telnet
Dextile
Thu Sep 11 22:46:09 2025
from
Calgary, Ab
via
Telnet
Dextile
Thu Sep 11 21:40:08 2025
from
Calgary, Ab
via
Telnet
Dextile
Thu Sep 11 15:05:03 2025
from
Calgary, Ab
via
Telnet
System Info
Sysop:
deepend
Location:
Calgary, Alberta
Users:
278
Nodes:
10 (0
/
10)
Uptime:
03:34:34
Calls:
2,369
Files:
5,012
D/L today:
18 files
(3,351K bytes)
Messages:
430,742
Synchronet Oneliners
Vintagegeek@rdbbs Fri Aug 22 05:53:33 2025 OpenWide
Serpentchain@rdbbs Tue Sep 2 20:21:16 2025 Glowing Apple Hums,
Serpentchain@rdbbs Tue Sep 2 20:21:26 2025 Telnet Whispers Through The Night,
Serpentchain@rdbbs Tue Sep 2 20:21:35 2025 BBS Dreams In Code.
Vintagegeek@rdbbs Wed Sep 3 11:26:08 2025 Heading to Banf f f
Vintagegeek@rdbbs Wed Sep 10 08:01:00 2025 Calgary next