Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const readline = require('readline')
- const fs = require('fs')
- const rl = readline.createInterface({
- input: fs.createReadStream('muestra_log.txt')
- })
- const pattern = /(.*?) (.*?) (.*?) \[(.*?)\] "(.*?) (.*?) (.*?)" (\d+?|-) (\d+?|-) "(.*?)" (.*?) "(.*?)" "(.*?)" ([\d\.]+?|-) "(\d*?|-)" "(.*?)"/
- let count = 0
- rl.on('line', function (line) {
- let matches = pattern.exec(line)
- if (matches) {
- // Do something
- }
- count++
- })
- rl.on('close', function (line) {
- console.log(`Processed ${count} lines`)
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement