Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 68,441 of 68,980    |
|    Zaidy036 to Herbert Kleebauer    |
|    Re: Replace line in a txt file with miss    |
|    11 Jan 24 19:20:54    |
   
   From: Zaidy036@air.isp.spam   
      
   On 1/11/2024 5:27 PM, Herbert Kleebauer wrote:   
   > On 11.01.2024 22:37, Zaidy036 wrote:   
   >   
   >> The fix was changing "IF %B==..." to "IF %%B==..."   
   >>   
   >> But you had success using "IF %B==..." and maybe a different version of   
   >> Windows 10. Mine is Pro (10.0.19045 build 19045).   
   >   
   > In my first post here I said, you have to double % in a batch:   
   >   
   > || Is _NN a variable and %_NN% its content or is the % in   
   > || _%_NN%NW-N.txt part of the file name (you should never use   
   > || a % in a file name. In a batch file you have to double the %.   
   >   
   >   
   > I posted the version which worked here. Why didn't you copy&past it?   
   >   
   > || ::@echo off   
   > ||   
   > || FOR /F "USEBACKQ TOKENS=1,2 DELIMS=:" %%A IN ("D:\_NW-B.txt") DO (   
   > || IF "%%B"=="" ECHO %%A >> D:\_NW-N.txt)   
   >   
   >   
   I did but over all of the tests confused or lost some changes.   
      
   %%B==" " requires the space and %%B=="" worked for you because my post   
   of input did not make that clear.   
      
   Thanks for staying with me on this. Starting within an Admin-Cmd window   
   showed an error even if it was the wrong one and made me go further.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca