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
System Info
Sysop:
deepend
Location:
Calgary, Alberta
Users:
287
Nodes:
10 (0
/
10)
Uptime:
03:51:03
Calls:
2,441
Files:
5,303
D/L today:
4 files
(1,579K bytes)
Messages:
443,264
Synchronet Oneliners
Brokenmind@rdbbs Wed Nov 26 13:50:08 2025 ThE iNSaNE AsYLuM BBs tiabbs.synchro.net
Vintagegeek@rdbbs Thu Nov 27 05:45:45 2025 HAPPY THANKSGIVING
Vintagegeek@rdbbs Fri Nov 28 14:18:50 2025 Amazon Prime Green Friday
Vintagegeek@rdbbs Fri Dec 5 06:02:20 2025 Maple Leafs
Pedro Herzensbuch@rdbbs Sat Dec 6 14:51:28 2025 Van a pasar cosas
Vintagegeek@rdbbs Sun Dec 7 13:30:36 2025 Merry Christmas