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,338 of 68,980    |
|    Petr Laznovsky to All    |
|    Re: For /F loop and Non-latin UTF-8 char    |
|    03 Nov 18 10:45:12    |
   
   From: nobody@nowhere.com   
      
   Dne 29.10.2018 v 11:03 JJ napsal(a):   
   > On Wed, 24 Oct 2018 14:17:02 +0200, Petr Laznovsky wrote:   
   >   
   >> Have FOR /F loop which perform sqlite DB query and process its output.   
   >>   
   >> for /f "tokens=*" %%a in ('echo %query% ^| %program%') do (echo %%a)   
   >>   
   >> where %query% is:   
   >>   
   >> SELECT icu_load_collation('cs_CZ', 'czech'); SELECT DISTINCT   
   >> customers.pid,customers.fname,customers.lname,customers.stnum   
   customers.flat_no,customers.city,customers.city_part,customers.m   
   il,customers.tel,customers.status,customers.cust_type,customers.   
   oin_date,customers.leave_date,customers.fee,customers.   
   varsym,customers.note,customers.db_type,streets.st   
   >> FROM customers,streets WHERE NOT customers.status BETWEEN 4 AND 4 AND   
   customers.cust_type BETWEEN 1   
   >> AND 3 AND customers.lname LIKE '©%' AND streets.st_index = cu   
   tomers.st_index ORDER BY lname;   
   >   
   > That FOR command alone won't work because the ")" character in the %query%   
   > variable is treated as the closing parethesis of the set enclosure for the   
   > FOR command.   
   >   
   > Unless the `echo %query%` command can be replaced with `echo "%query%"`, one   
   > workaround is to move the commandline out of the FOR's set parameter and   
   > redirect the output into a file. Then use TYPE for the FOR's set parameter.   
   >   
      
   It does not explain why it DOES work wit ASCII character, but NOT work with   
   non-ascii character.   
      
   --- 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