Extract ac no from text file and save in excel

i have account no in text file like
Account Branch: 2551-PUNE LCB 411001 DATE: 11-05-21 12:32:10 PM
IFSC : CNRB0002551
MICR : 4110150431

Account No : 2551367005229
Product Name: Advances to NBFCs
i want to extract 2551367005229 and save in excel

Hi

Please try below ,

AccNo = InputString.Split({“Account No :”},StringSplitOptions.None)(1).Trim.Split({“Product Name”},StringSplitOptions.None)(0)

do u have xmal how you take from txt file

Nice Idea @Krishna_547

I have a similar idea

image

You can use the “Read Text File” Activity and save the result in an String Variable

in matches which pattern you used

Flowchart.xaml (8.5 KB)

yes now i am trying to save it in excel use for each row activity and build data table.showing error in var in for each.My flow pls check
try.xaml (9.4 KB)
city.txt (3.6 KB)

Build data table don’t use read range before only you have to fill the heder in the excel that excels you have to read the extract the data use REGEX using ismatch activity
code is like this (?<=Account No :\s)\d+ save it in a variable

Then Use Add data row

then use write range

Regards
Chethan P

Hi @sayali_rokade,

SaveAccountNumber.xaml (5.2 KB)

Thanks!

Hi ,

Please find below,

GetAccountNumber.zip (8.7 KB)

Hi, you can use scrapping native method to scrap data from text file…
It will work fine.
Thank you

I use in Match
“Account No : \d+”

Try like below,

fetch entire text file string into a variable
use split(variable,chr(10)) and store in array variable
now use
for each item in array variable
if arrayvariable(item).tostring.toupper.contains(“ACCOUNT NUMBER”) then
assign output variable as arrayvariable(item).tostring.toupper.replace(“ACCOUNT NUMBER:”,"")