Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #41257

How to read an identified part of a huge text file?

From Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups comp.lang.javascript
Subject How to read an identified part of a huge text file?
Date 2023-04-02 15:51 +0200
Organization A noiseless patient Spider
Message-ID <u0c19l$2hc4f$1@dont-email.me> (permalink)

Show all headers | View raw


I want to read identified content from a huge text file that resides in
the file system. (My javascript code is embedded in a HTML page. I am
running all code client side and have no application servers or data
base systems running.)

I've found a suggestion using 'require("fs")' but the samples required
to load the whole file content so doesn't seem to fit for my megabytes
large data file which I strictly want to avoid loading as a whole.

My data file is actually structured as  <key> <TAB> <text-data>  lines
and I just want to extract the <text-data> given the respective <key>.
Is there some simple standard way to achieve that extraction?

The second question is whether it is possible to find the <key>s given
a text-match (a string match or ideally a regular expression match) on
the respective <text-data> on the external file?

For a solution/workaround to both questions it might be also useful to
call an external extractor (awk, perl, ...) from javascript and read in
the output of such an external tool invocation. - Is that possible?

Thanks for any hints.

Janis

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

How to read an identified part of a huge text file? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2023-04-02 15:51 +0200
  Re: How to read an identified part of a huge text file? Jon Ribbens <jon+usenet@unequivocal.eu> - 2023-04-02 14:49 +0000
    Re: How to read an identified part of a huge text file? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2023-04-02 20:05 +0200
      Re: How to read an identified part of a huge text file? Jon Ribbens <jon+usenet@unequivocal.eu> - 2023-04-02 19:58 +0000
      Re: How to read an identified part of a huge text file? JJ <jj4public@outlook.com> - 2023-04-03 06:08 +0700
  Re: How to read an identified part of a huge text file? V <vvvvvvvvvvvvvvvvvvvv11111@mail.ee> - 2023-04-03 06:55 -0700
  Re: How to read an identified part of a huge text file? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2023-04-04 17:59 -0700

csiph-web