-1
Well, I wanted through a txt file, to transform the lines into arrays (if it is better) to search within it a sequence with 9 numbers, and then link to an image. Obs: within the txt’s that will be read there will be more than one sequence with 9 numbers. can do this with Ode or other technology
const readline = require('readline')
const fs = require('fs')
const readable = fs.createReadStream('Marcas2507.txt')
var rl = readline.createInterface({
input : readable,
output: process.stdout
})
rl.on('line',function(line){
console.log(line) // Não sei como transformar o txt em um array para identificar uma sequencia de 9 numeros nele
})
You can give examples of what the
.txt
?– Sergio
916427416 Publication of opposition registration request (formal examination completed) Holder: restricted Date of filing: 12/13/2018 Presentation: restricted Nature: restricted Nominative element: restricted CFE: 27.5.1 NCL(11): 41 Specification: restricted; Proxy: restricted
– Guilherme Henrique
after the sequence of 9 numbers(process number) there is a line break
– Guilherme Henrique
And what do you want to do is extract these 9 digits each time they appear? Is the structure always the same? (ie: numbers > line break > text | and the same repeated N times)
– Sergio
I want to link these 9 numbers to an image (as if it were an image naming through the process number (the 9 numbers in the case). And yes there is always a line break every time these 9 digits appear
– Guilherme Henrique
You could read the whole file at once and do something like this: https://jsfiddle.net/Sergio_fiddle/btLpn6x1/ is what you’re looking for?
– Sergio
How would I identify this 9-number sequence of this JSON to switch to an image or place within an array? only the numbers
– Guilherme Henrique
I still don’t fully understand what you want to do... have you seen my jsFiddle? there is created an array as you look. That’s not how you thought?
– Sergio
I’m sorry I didn’t make it clear, here’s the deal. i want to develop a software that reads a complete txt file and extracts from it only the processes(sequence of 9 numbers) and store this data somehow, so that then I link each process with a specific image. in your example you have stored all the information within the array. i just want to store the process number.
– Guilherme Henrique
https://jsfiddle.net/Sergio_fiddle/btLpn6x1/4/ ?
– Sergio
perfect, thank you very much!!
– Guilherme Henrique