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
realjameswilliam
Tue Mar 24 05:40:41 2026
via
HTTPS
Guest
Thu Mar 19 21:02:10 2026
from
One, Two
via
Telnet
Deepend
Wed Mar 18 08:26:50 2026
from
Calgary, Ab
via
HTTPS
Tsukaj
Tue Mar 17 22:32:32 2026
from
Tennessee
via
Telnet
System Info
Sysop:
deepend
Location:
Calgary, Alberta
Users:
297
Nodes:
10 (0
/
10)
Uptime:
06:22:49
Calls:
2,510
Files:
5,732
D/L today:
34 files
(10,496K bytes)
Messages:
464,461
Posted today:
1
Synchronet Oneliners
Vintagegeek@rdbbs Thu Mar 5 09:15:57 2026 To the Beach
Vintagegeek@rdbbs Fri Mar 6 17:07:01 2026 To The LifeBoats
Vintagegeek@rdbbs Sun Mar 8 10:57:24 2026 Firefly - Serenity
Kat@rdbbs Wed Mar 11 14:52:38 2026 Hello erryone!
Jmay@rdbbs Fri Mar 13 20:32:57 2026 Burning the oatmeal
Tsukaj@rdbbs Tue Mar 17 22:27:28 2026 hell yeah this is so cool