home bbs files messages ]

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 67,840 of 68,980   
   John Stockton to LangerTom   
   Re: Problem with file trimming in Batch   
   01 Dec 21 15:35:18   
   
   From: dr.j.r.stockton@gmail.com   
      
   On Tuesday, 30 November 2021 at 18:24:13 UTC, LangerTom wrote:   
   > I believe that your command    
   > SET ZC=1    
   > is working fine, but checking its result with    
   > echo === %ZC%    
   > is going wrong because both lines are placed between round brackets.    
      
   Not actually wrong, as it shows that %ZC% is not returning what I want;   
   and so explains why the next line,    if [%ZC%] == [1] (   , is not doing   
   what I wanted it to do  .   
      
   > CMD.EXE is reading all code between round brackets at once and is    
   > resolving variables like %ZC% during code reading. At this time your    
   > command    
   > set ZC=1    
   > did not take place yet.    
   > To avoid this switch on DELAYEDEXPANSION and note variables like this; !ZC!    
   >    
   > The following code should work (not tested):    
      
   It does.  I copied the whole lot, and it ran.  All that I now want is to   
   arrange that the second #### sets ZC to something other than 1, which should   
   be easy (P.S. it was : set /a ZC=1-!ZC!).  And I don't want the #### marks to   
   appear in the output as    
   rendered on the screen, but using       instead should serve.   
      
   I control the input file; I can alter its content in any way that does not   
   adversely affect what appears on the screen when the HTML is rendered.  The   
   present part, a pre-processor,  just copies the HTML unchanged (I hope), but   
   omitting blocks that I do    
   not want in the output.   
      
   > HTH Thomas    
   >    
   > By the way: working on html with batch is very hard stuff because html    
   > code contains many poison characters like <>?*/"&    
      
   Understood.  No problem here.  It is the code which runs next that handles the   
   HTML; it copies the wanted lines, which are those containing the name-strings   
   provided as arguments, and separately lists the contents of the first   href="   
   ... ">   in each    
   of those lines for XCOPYing as in my previous thread here.  As the input is   
   HTML, if there is a second such link on one of those lines line I will just   
   insert a newline in the input - I think.   
      
   Thanks again!                    |   
      
   --    
     (c) John Stockton, near London, UK.  Using Google Groups.           |   
      
   --- 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