read text from *.txt-files and save it to variables
Posted: Thu Jul 11, 2019 11:02 am
Hello there,
I convert the incoming pdf with callasToolbox to *.txt-files. In the next step, I want to extract the text from these files and save it to a variable, so that I could have a regex search ran on this and find specific Numbers that fit my patterns.
My code so far:
const fs = require('fs')
fs.readFile('Input.txt', 'utf-8', (err, data) => {
if (err) throw err;
console.log(data);
My Question is in wich variable or such do I need to save the data in, to use it afterwards?
Thanks in Advance,
Ben
I convert the incoming pdf with callasToolbox to *.txt-files. In the next step, I want to extract the text from these files and save it to a variable, so that I could have a regex search ran on this and find specific Numbers that fit my patterns.
My code so far:
const fs = require('fs')
fs.readFile('Input.txt', 'utf-8', (err, data) => {
if (err) throw err;
console.log(data);
My Question is in wich variable or such do I need to save the data in, to use it afterwards?
Thanks in Advance,
Ben