This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
trips: [{ | |
id: "1", | |
duration: "1720", | |
prodBlocked: [], | |
prods: { | |
1: { | |
id: 1, | |
cabin: 1, | |
flt: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = [ | |
{ | |
airline: "COPA", | |
adults: 1, | |
departureDate: "2018-03-01", | |
destinationAirportCode: "GRU", | |
originAirportCode: "PAP" | |
}, | |
{ | |
airline: "COPA", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static DataTable ConvertResultRegex(DataTable regexList) | |
{ | |
DataTable result = new DataTable(); | |
result.Columns.Add("descricao"); | |
foreach(DataRow row in regexList.Rows) | |
{ | |
foreach(DataColumn column in regexList.Columns) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const path = "./page.html"; | |
const activate = () => { | |
return new Promise((resolve, reject) => { | |
fs.readFile(path, (event, prev) => { | |
if (prev != null) { | |
resolve(prev.toString()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
DataTable regexList = new DataTable(); | |
string path = @"[A-Z]{2}\d{8}"; | |
regexList.Columns.Add("Estados"); | |
regexList.Columns.Add("Campos"); | |
regexList.Columns.Add("Regex"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static DataTable getListRegex(DataTable regexList, DataTable colletionText) | |
{ | |
DataTable resultRegex = new DataTable(); | |
resultRegex.Columns.Add("Estados"); | |
resultRegex.Columns.Add("Multas"); | |
resultRegex.Columns.Add("Campos"); | |
resultRegex.Columns.Add("Resultado"); | |
resultRegex.Columns.Add("PDF"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string ReadStreamPDF(string path) | |
{ | |
StringBuilder text = new StringBuilder(); | |
using (PdfReader reader = new PdfReader(path)) | |
{ | |
for (int i = 1; i <= reader.NumberOfPages; i++) | |
{ | |
text.Append(PdfTextExtractor.GetTextFromPage(reader, i)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regexList = [ | |
{ | |
Estado: "PE", | |
Campo: "AIT", | |
Regex: /[A-Z]{2}\d{8}/g | |
}, | |
{ | |
Estado: "BA", | |
Campo: "Valor", | |
Regex: /\d{3}([.])\d{2}/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static DataTable getResultRegex(string text) | |
{ | |
DataTable gridList = new DataTable(); | |
gridList.Columns.Add("Match"); | |
string pattern = @"[A-Z]{2}\d{8}"; | |
foreach (Match m in Regex.Matches(text, pattern)) | |
{ | |
gridList.Rows.Add(m.Value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static DataTable getResultRegex(string text) | |
{ | |
DataTable gridList = new DataTable(); | |
DataTable result = new DataTable(); | |
gridList.Columns.Add("Match"); | |
result.Columns.Add("Result"); | |
string pattern = @"([0-9]{9})"; | |
foreach (Match m in Regex.Matches(text, pattern)) |