[NTG-context] t-scancsv_ConTeXT_module can't filter anymore

Pablo Rodriguez oinos at gmx.es
Mon Sep 17 20:34:56 CEST 2018


On 9/17/18 7:50 PM, Jorge Manuel wrote:
>> [...]
>> My guess is that you need to enclose text strings in quotes, so that
>> your conditionals read:
>>
>>   \doloopif{\Flag}{~=}{"anl"}{\lineaction}
>>   \doloopif{\Flag}{==}{"anl"}{\lineaction}
> 
> Thanks for your reply. This code don’t work.  I would try your
> handlecsv module. I need to adapt my old .tex files.
I was wrong. Quotes aren’t required.

See minimal example (which works both with handlecsv and scancsv):

    \usemodule[handlecsv]% scancsv works too
    \opencsvfile{cities.csv}
    \starttext
    \startbuffer
    This is located in Germany: \cA\par
    \stopbuffer
    \section{Cities in Germany}
    \doloopif{\cB}{==}{Germany}{\getbuffer}
    \section{Cities not in Germany}
    \doloopif{\cB}{~=}{Germany}{\getbuffer}
    \stoptext

Contents from "cities.csv" read:

    "Berlin";"Germany"
    "Paris";"France"
    "London";"UK"
    "New York";"USA"
    "Munich";"Germany"
    "Lisbon";"Portugal"
    "Dublin";"Ireland"
    "Warsaw";"Poland"
    "Vienna";"Austria"
    "Barcelona";"Spain"

Just in case it helps,

Pablo
-- 
http://www.ousia.tk


More information about the ntg-context mailing list