ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] How to input first n lines from file?
       [not found] <1110465124.1306185.1702762249824.ref@mail.yahoo.com>
@ 2023-12-16 21:30 ` Joel via ntg-context
  2023-12-16 21:44   ` [NTG-context] " Henning Hraban Ramm
  0 siblings, 1 reply; 2+ messages in thread
From: Joel via ntg-context @ 2023-12-16 21:30 UTC (permalink / raw)
  To: Mailing List for ConTeXt Users; +Cc: Joel


[-- Attachment #1.1: Type: text/plain, Size: 268 bytes --]

With the command `\input file`, I can input the entire contents of `file.tex`. Is there a way to limit it to the first n lines, for instance, something like `\input[10]` file would only input the first 10 lines from `file.tex` and ignore the rest of the lines.
--Joel

[-- Attachment #1.2: Type: text/html, Size: 553 bytes --]

[-- Attachment #2: Type: text/plain, Size: 511 bytes --]

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

* [NTG-context] Re: How to input first n lines from file?
  2023-12-16 21:30 ` [NTG-context] How to input first n lines from file? Joel via ntg-context
@ 2023-12-16 21:44   ` Henning Hraban Ramm
  0 siblings, 0 replies; 2+ messages in thread
From: Henning Hraban Ramm @ 2023-12-16 21:44 UTC (permalink / raw)
  To: ntg-context

Am 16.12.23 um 22:30 schrieb Joel via ntg-context:
> With the command `\input file`, I can input the entire contents of 
> `file.tex`. Is there a way to limit it to the first n lines, for 
> instance, something like `\input[10]` file would only input the first 10 
> lines from `file.tex` and ignore the rest of the lines.

With \typebuffer you can define a "range", see 
https://wiki.contextgarden.net/Command/typebuffer

But I guess you should write a Lua function that suits your use case.

Hraban

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2023-12-16 21:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1110465124.1306185.1702762249824.ref@mail.yahoo.com>
2023-12-16 21:30 ` [NTG-context] How to input first n lines from file? Joel via ntg-context
2023-12-16 21:44   ` [NTG-context] " Henning Hraban Ramm

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).