ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Why any substring is not find inside string?
@ 2010-04-11 17:30 Jaroslav Hajtmar
  2010-04-11 19:33 ` Jaroslav Hajtmar
  0 siblings, 1 reply; 2+ messages in thread
From: Jaroslav Hajtmar @ 2010-04-11 17:30 UTC (permalink / raw)
  To: ntg-context

Hello,
Sorry for my beginners question.
I am experimenting with CSV parsing and I have miscellaneous delimiters.
Finding any delimiters is OK, but with any delimiters are problem - 
there are not to find inside string.
Here is my minimal example:


\starttext
\startluacode
text2split='"1";"GYZA";"382/2010";"482/2010";"402";"Májkova";"Barbora";"20.4.1995";"Zábřeh, 
Skalička 48";"789 53"'
delim_from, delim_to = string.find(text2split, '";"')
tex.sprint(tostring(delim_from),' - ', tostring(delim_to),'\\par') -- OK


text2splitA='!1/;!GYZAs 482/2010/;!GYZA 382/2010/;!GYZA 
482/2010/;!402/;!Májková/;!Barbora/;!ž/;!20.4.1995/;!Zábřeh/;!ČR/;!Mírov 
69/;!Mírov/;!789 53/;!Májková/;!Michaela/;!Mírov 69/;!Mírov/;!789 53/;!/'
delim_from, delim_to = string.find(text2splitA, '!;/')
tex.sprint(tostring(delim_from),' - ', tostring(delim_to)) -- Not finding
\stopluacode

\stoptext

Where is problem, where I making a mistake (I am beginning with Lua).

Thanx Jaroslav Hajtmar

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Why any substring is not find inside string?
  2010-04-11 17:30 Why any substring is not find inside string? Jaroslav Hajtmar
@ 2010-04-11 19:33 ` Jaroslav Hajtmar
  0 siblings, 0 replies; 2+ messages in thread
From: Jaroslav Hajtmar @ 2010-04-11 19:33 UTC (permalink / raw)
  To: hajtmar, mailing list for ConTeXt users

Sorry ... I see it now..
When I created mimimal example I make mistake.

J.Hajtmar


Dne 11.4.2010 19:30, Jaroslav Hajtmar napsal(a):
> Hello,
> Sorry for my beginners question.
> I am experimenting with CSV parsing and I have miscellaneous delimiters.
> Finding any delimiters is OK, but with any delimiters are problem - 
> there are not to find inside string.
> Here is my minimal example:
>
>
> \starttext
> \startluacode
> text2split='"1";"GYZA";"382/2010";"482/2010";"402";"Májkova";"Barbora";"20.4.1995";"Zábřeh, 
> Skalička 48";"789 53"'
> delim_from, delim_to = string.find(text2split, '";"')
> tex.sprint(tostring(delim_from),' - ', tostring(delim_to),'\\par') -- OK
>
>
> text2splitA='!1/;!GYZAs 482/2010/;!GYZA 382/2010/;!GYZA 
> 482/2010/;!402/;!Májková/;!Barbora/;!ž/;!20.4.1995/;!Zábřeh/;!ČR/;!Mírov 
> 69/;!Mírov/;!789 53/;!Májková/;!Michaela/;!Mírov 69/;!Mírov/;!789 53/;!/'
> delim_from, delim_to = string.find(text2splitA, '!;/')
> tex.sprint(tostring(delim_from),' - ', tostring(delim_to)) -- Not finding
> \stopluacode
>
> \stoptext
>
> Where is problem, where I making a mistake (I am beginning with Lua).
>
> Thanx Jaroslav Hajtmar
>
> ___________________________________________________________________________________ 
>
> If your question is of interest to others as well, please add an entry 
> to the Wiki!
>
> maillist : ntg-context@ntg.nl / 
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________ 
>
>

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-11 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-11 17:30 Why any substring is not find inside string? Jaroslav Hajtmar
2010-04-11 19:33 ` Jaroslav Hajtmar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).