Hello, I'd need to \typefile a file from n-th line (= ignoring first n-1 lines). Is there such an option for \typefile macro? (http://wiki.contextgarden.net/Reference/en/typefile is silent.) I tried: \typefile[default][lines={10}]{a_file.txt} % Start at line 10 \typefile[default][lines={10,+1}]{a_file.txt} % Start at line 10, step = 1 \typefile[default][start=10]{a_file.txt} % Start at line 10 \typefile[default][from=10]{a_file.txt} % Start at line 10 No success. (The last Ctx minimals, WinXP.) Lukas
2010/10/15 Procházka Lukáš Ing. - Pontex s. r. o.
Hello,
I'd need to \typefile a file from n-th line (= ignoring first n-1 lines).
Is there such an option for \typefile macro? (http://wiki.contextgarden.net/Reference/en/typefile is silent.)
I tried:
\typefile[default][lines={10}]{a_file.txt} % Start at line 10
\typefile[default][lines={10,+1}]{a_file.txt} % Start at line 10, step = 1
\typefile[default][start=10]{a_file.txt} % Start at line 10
\typefile[default][from=10]{a_file.txt} % Start at line 10
No success.
(The last Ctx minimals, WinXP.)
Lukas Not an answer, but quick recipe: With mkiv is trivial ; use lua to skip the first n-1 lines. With mkii just use luatex as lua interpreter to call with \executesystemcommand and then see previous point.
-- luigi
Am 2010-10-15 um 09:16 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
I'd need to \typefile a file from n-th line (= ignoring first n-1 lines).
\typefile[default][start=10]{a_file.txt} % Start at line 10
According to older ML messages and the source, \typefile[start=10] should work. Maybe it need "stop" also? Otherwise it's undocumented. see http://source.contextgarden.net/tex/context/base/buff-ver.mkii?search=typefi... (MkII) http://source.contextgarden.net/tex/context/base/buff-ver.mkiv?search=typefi... (MkIV) Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
Hello, it doesn't seem to work. Let's have "t-TypeF2.mkiv" with the following content: --- \setuptyping[default][bodyfont=small,style={\ttx\setupinterlinespace}] % 1 % 2 \starttext % 3 \typefile[default][start=4]{t-TypeF2.mkiv} % = This file; 4 \typefile[default][start=4,stop=99]{t-TypeF2.mkiv} % = This file; 5 \typefile[default][lines={4,+1}]{t-TypeF2.mkiv} % = This file; 6 \stoptext % 7 --- If you see the result, all lines are printed in all cases. Moreover, "4" and "99" are also printed in the front and at the end of the typed file in the second case. 2Luigi:
Not an answer, but quick recipe: With mkiv is trivial ; use lua to skip the first n-1 lines. With mkii just use luatex as lua interpreter to call with \executesystemcommand and then see previous point.
I had also such idea, but I believed to be simply solvable even with the existing \typefile command - supposing there is start/stop line option (or it couldn't be so complicated to provide them). So I supposed the valid syntax is unknown for me.
Lukas
On Fri, 15 Oct 2010 10:00:10 +0200, Henning Hraban Ramm
\typefile[default][start=10]{a_file.txt} % Start at line 10
According to older ML messages and the source, \typefile[start=10] should work. Maybe it need "stop" also? Otherwise it's undocumented.
see http://source.contextgarden.net/tex/context/base/buff-ver.mkii?search=typefi... (MkII) http://source.contextgarden.net/tex/context/base/buff-ver.mkiv?search=typefi... (MkIV)
-- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
On Fri, Oct 15 2010, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
I'd need to \typefile a file from n-th line (= ignoring first n-1 lines).
\starttext % 1 \typefile[range=3]{test.tex} % 2 bla % 3 bla % 4 bla % 5 bla % 6 \stoptext % 7 See also: http://tracker.luatex.org/view.php?id=475 Cheers, Peter -- Contact information: http://pmrb.free.fr/contact/
... Yes, thanks, that's it:
\typefile[default][range={3,5}]{t-TypeF2.mkiv} % If also the upper limit is to be specified
Regards,
Lukas
On Fri, 15 Oct 2010 10:09:13 +0200, Peter Münster
On Fri, Oct 15 2010, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
I'd need to \typefile a file from n-th line (= ignoring first n-1 lines).
\starttext % 1 \typefile[range=3]{test.tex} % 2 bla % 3 bla % 4 bla % 5 bla % 6 \stoptext % 7
See also: http://tracker.luatex.org/view.php?id=475
Cheers, Peter
-- Ing. Lukáš Procházka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezová 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038
participants (4)
-
Henning Hraban Ramm
-
luigi scarso
-
Peter Münster
-
Procházka Lukáš Ing. - Pontex s. r. o.