MLT
(MLT)
December 15, 2020, 10:10am
1
Hi,
I want to extract the “ABC” and then “SB” and again same for the second row using regex. I have no idea how to extract it from table which contains multiple values. Please help me with this.
Thanks in advance
hasib08
(Motiwala Hasib)
December 15, 2020, 10:23am
2
First, you have to convert it into Text format and then we can apply Regex based on the Input.
MLT
(MLT)
December 15, 2020, 10:27am
3
Hi @hasib08 thanks for the suggestion.
if i convert it on to text like below:
Level
Institution Name
University / Board Name
10th
ABC
SB
How to apply condition on this to get the first row ?
hasib08
(Motiwala Hasib)
December 15, 2020, 10:31am
4
MLT:
Level
Institution Name
University / Board Name
10th
ABC
SB
Can you share it in Notepad
MLT
(MLT)
December 15, 2020, 10:34am
5
1 Like
Hi u can try this regex
(?<=10th).*
Where u can get both ABC and SB in a single string. Then u can use string Operation like split to split the both values
Hope it helps you
Regards
Nived N
Happy Automation
Hello MTL,
In this video, I have 17 use-cases for extracting tables from PDF and write data in Excel:
Your PDF is here:
55:50 File 11 simple PDF with protection empty Cells
Code:
'FILE1
Dim strtmp As String
strtmp = strin.Substring(strin.IndexOf("Number"), strin.IndexOf("Subtotal") - strin.IndexOf("Number")).Trim
strout = strtmp.Replace(" ", "|")
strtmp = strin.Substring(strin.IndexOf("Subtotal") + 8)
strpar = strtmp.Substring(0, strtmp.IndexOf(Environment.NewLine)).Trim
'FILE2
Dim strtmp As String
Dim strout As String
strout = "Col1|Col2|Col3|Col4"
strtmp = strin.Substring(strin.IndexOf("Vacancies") + 11).Trim
For Each line As String In strtmp.Split(New String() {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)
If (line.Length > 3) Then
If (IsNumeric(line(0))) And (line(1) = " ") And (line(2) = " ") Then
strout = strout + Environment.NewLine + line.Replace(" ", "").Replace(" ", "|").Trim
ElseIf (line(0) = "") And (line(1) = " ") And (line(2) = " ") Then
strout = strout + line.Replace(" ", "$").Trim()
This file has been truncated. show original
Thanks,
Cristian Negulescu