rsr
(Intelligence RPA )
April 20, 2021, 6:10am
1
Hello Community,
I have a excel file where is column that have few numbers which is 16 digit and 12 digit mixed.Like
column1
3236540987994661
3286540987994561
3234540987994561
234985129923
134985129923
134985199923
I need to find, if number is 16 digit then it will search 11 and 12 position of a number and find ‘99’ in 11 and 12 position then print find number else no and
if number is 12 digit then it will search 9 and 10 position of a number and try to find ‘99’ in 9 and 10 position then print find number else no
please some one help me.
Advanced thanks
prasath_S
(prasath S)
April 20, 2021, 6:15am
2
Hi @rsr
Please try this,
Read the excel and Store in datatable. Variable name dt
Use for each row
Inside for each put an if activity and condition will be row(“columnname”). tostring.length = 16
In then part of if activity put another if activity and in condition give row(“columnname”).tostring.substring(11,2) = 99
In then part put log message and give row(“columnname”). tostring and in else give no
Do same like that for else part of first if condition…
row(“columnname”).tostring.substring(9,2) = 99 - it will search for 9th and 10th position
ppr
(Peter Preuss)
April 20, 2021, 6:51am
3
we can do with regex:
and substring
OR
rsr
(Intelligence RPA )
April 20, 2021, 2:11pm
4
Hi @prasath_S , its not working. Can you check my workflow?
prasath_S
(prasath S)
April 20, 2021, 2:20pm
5
can you share your workflow please…
rsr
(Intelligence RPA )
April 20, 2021, 2:28pm
6
I am newbie in forum thats why i am not able to upload. Please check this link
prasath_S
(prasath S)
April 20, 2021, 2:41pm
7
Please use this workflow,
use your column name instead if columnname,
sample.xaml (9.8 KB)
rsr
(Intelligence RPA )
April 20, 2021, 3:06pm
8
Did you check my workflow with file?
your flow showing error:
“If: startIndex cannot be larger than length of string.\r\nParameter name: startIndex”,
prasath_S
(prasath S)
April 20, 2021, 3:45pm
9
Is all the number greater that 10 and also did you check the logs how many number and no came…
rsr
(Intelligence RPA )
April 20, 2021, 3:51pm
10
Hi,
CurrentRow(“Loan Account”).tostring.substring(9,2) = “99”
(9,2) is it start with 0 or 1 when it will count?
prasath_S
(prasath S)
April 20, 2021, 3:53pm
11
It will start at 10th position and have 2 characters,
If the string is abcdefghijklmno then the result is kl
prasath_S
(prasath S)
April 20, 2021, 4:39pm
13
Kl is the 10th and 11th postion of the string “abcdefghijklmno”
2.the string index starts with 0.
3.yes it will work
1 Like
prasath_S
(prasath S)
April 21, 2021, 5:56am
14
Please find the updated workflow and excel,
I have deleted the first row in your excel,
The new sheet called result wiill be created,
sample (1).xaml (14.8 KB) Calculation Sheet - Copy.xlsx (18.3 KB)
1 Like
rsr
(Intelligence RPA )
April 21, 2021, 6:10am
15
Actually it’s great but look value display
I need to display exact value not like msg box. How it is possible?
and its showed length is 20
Thank you
rsr
(Intelligence RPA )
April 21, 2021, 6:23am
16
Hey I am really sorry to say again.
Did you check?
prasath_S
(prasath S)
April 21, 2021, 6:25am
17
Yes i removed the message box already dont know how old file uploaded,
can you check this workflow has any message box , if it didnt it should work
sample (1).xaml (14.8 KB)
system
(system)
Closed
April 24, 2021, 6:26am
18
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.