“Knotenlesedateizeile” Code-Antworten

Knotenlesedateizeile

const fs = require('fs');
const readline = require('readline');

async function processLineByLine() {
  const fileStream = fs.createReadStream('input.txt');

  const rl = readline.createInterface({
    input: fileStream,
    crlfDelay: Infinity
  });
  // Note: we use the crlfDelay option to recognize all instances of CR LF
  // ('\r\n') in input.txt as a single line break.

  for await (const line of rl) {
    // Each line in input.txt will be successively available here as `line`.
    console.log(`Line from file: ${line}`);
  }
}

processLineByLine();
BA

Dateizeile nach Zeilenreaderknoten js

lineReader.open('file.txt', function(reader) {
  if (reader.hasNextLine()) {
    reader.nextLine(function(line) {
      console.log(line);
    });
  }
});
Clumsy Cicada

Ähnliche Antworten wie “Knotenlesedateizeile”

Fragen ähnlich wie “Knotenlesedateizeile”

Weitere verwandte Antworten zu “Knotenlesedateizeile” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen