Skip to content

Read csv files from zip file #451

Answered by gildas-lormeau
wrnrlr asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think it's possible since it depends on controller. However, the performance could be improved by not using await when calling getData and csvFromZipEntry. The exception getData might trow can also be ignored, because the stream (i.e. readable) can propagate it.

Here's below the code with these changes applied.

import {
  ZipReader,
  ZipWriter,
  terminateWorkers,
  Uint8ArrayWriter,
  Uint8ArrayReader,
  TextReader
} from 'https://deno.land/x/zipjs@v2.7.29/index.js';
import {
  initParser,
  inferSchema
} from 'https://esm.sh/udsv@0.5.3';

class CSVDecoderStream extends TransformStream {
  constructor() {
    super();
    let csvParser;
    const csvReducer = (controller, rows) => 

Replies: 2 comments 11 replies

This comment has been hidden.

@wrnrlr
Comment options

@gildas-lormeau
Comment options

@gildas-lormeau

This comment has been hidden.

@wrnrlr
Comment options

Comment options

You must be logged in to vote
7 replies
@wrnrlr
Comment options

@gildas-lormeau
Comment options

@leeoniya
Comment options

@gildas-lormeau
Comment options

Answer selected by gildas-lormeau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants