Japp
(Juan)
August 13, 2020, 9:28pm
1
Hi,
I want to extract all matches to a datatable, separated in columns by Groups.
DT would be something like this:
A ---------- B
100-------1643
101--------
102--------
103--------23457
104--------235
105--------
Can help me please?
I can’t find a way to do this…
Thanks!!
1 Like
TimK
(Tim Kok)
August 14, 2020, 1:12am
2
Can you provide your input to this problem so we can try identify how to assist you
1 Like
Japp
(Juan)
August 14, 2020, 1:49am
3
Hello,
I copy a fragment down!
Where 00xxx its group 1 (always existe) and the ammount is group 2.
My pattern:
“(00\d{3})\s(\ - * \d * \ ,* \ d *)”
Desarrollo (N) 00103 27456,04
Concesiones (N) 00104
Patentes, licencias, marcas y similares (N) 00105
Fondo de comercio (N, A, P) 00106 1325,03
Aplicaciones informáticas (N) 00107 8757,92
Investigación (N) 00108
Propiedad intelectual (N) 00700
Otro inmovilizado intangible (N) 00109 -5643,01
Resto (A, P) 00110
1 Like
@Japp @Japp Use following regex (00\d{3})\s([\d,-]+)
to extract String together and group1, group2.
System.Text.RegularExpressions.Regex.Matches(InputVariable,“(00\d{3})\s([\d,-]+)”). It will give you a collection of matches. Use For Each and Add Data row to insert the group values into DataTable item.Groups(1) and item.Groups(2)
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
1 Like
Japp
(Juan)
August 14, 2020, 8:46am
5
Hi, thanks for answer!
So my sequence, could be…
Create datatable
Read PDF
Matches (Result =“resultmatches”) pattern ((00\d{3})\s([\d,-]+))
For each (item in resultmatches)
Add row to datatable
System.Text.RegularExpressions.Regex.Matches(InputVariable,“(00\d{3})\s([\d,-]+)”) and item.groups(1)
When i put that i have a error… Where i put this?
1 Like
@Japp group1 value will be item.groups(1).value and similarly
item.groups(2).value
3 Likes
Japp
(Juan)
August 15, 2020, 5:15pm
8
Hi again!!
Now im triying to extract the matches of each file in diferents columns, for example…
A-B-C-D-E-F
1-2-1-2-1-2
1-2-1-2-1-2
1-2-1-2-1-2
Im using for each file in directory.getfiles(“path”) but the extraction give me all the extract data of each file in the same column:
A-B
1-2 (File 1)
1-2 (File 1)
1-2 (File 1)
1-2 (File 2)
1-2 (File 2)
1-2 (File 2)
1-2 (File 3)
1-2 (File 3)
1-2 (File 3)
system
(system)
Closed
August 18, 2020, 5:15pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.