From: Jaroslav Hajtmar <hajtmar@gyza.cz>
To: ntg-context@ntg.nl
Subject: Why any substring is not find inside string?
Date: Sun, 11 Apr 2010 19:30:04 +0200 [thread overview]
Message-ID: <4BC2071C.7000604@gyza.cz> (raw)
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
___________________________________________________________________________________
next reply other threads:[~2010-04-11 17:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-11 17:30 Jaroslav Hajtmar [this message]
2010-04-11 19:33 ` Jaroslav Hajtmar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BC2071C.7000604@gyza.cz \
--to=hajtmar@gyza.cz \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).