Extracting data from notepad

Hi Everyone

i have a notepad with the data
Account Number:786494623832

Bank: IDBI

Branch:MIYAPUR

Loan Taken On: 24-JAN-2004

Amount: 2500000

EMI(month): 6500

i want to get the acano,branchname,…

how to do that
can you please explain

HI @jayanthi_bureddy

(?<=Account Number:)(\d+)

(?<=Branch:)([A-Za-z]+)

(?<=Bank:\s*)([A-Za-z]+)

(?<=Loan Taken On:\s*)([A-Za-z0-9\-]+)

(?<=EMI.*:\s*)([A-Za-z0-9\-]+)

(?<=Amount:\s*)([A-Za-z0-9\-]+)






Regards

2 Likes

Hi ,

You can use regex to get the desired result.

1 Like

Hi @jayanthi_bureddy

β†’ Build Data Table


Output-> dt_Output
β†’ Read Text File
Output-> str_Text
β†’ Use below syntaxes in Assign activity:

-> AccNumber= System.Text.RegularExpressions.Regex.Match(str_Text,"(?<=Account Number:)(\d+)").Value

-> Bank= System.Text.RegularExpressions.Regex.Match(str_Text,"(?<=Bank:\s*)([A-Za-z]+)").Value

-> Branch= System.Text.RegularExpressions.Regex.Match(str_Text,"(?<=Branch:)([A-Za-z]+)").Value

-> LoanTaken= System.Text.RegularExpressions.Regex.Match(str_Text,"(?<=Loan Taken On:\s*)([A-Za-z0-9\-]+)").Value

-> Amount= System.Text.RegularExpressions.Regex.Match(str_Text,"(?<=Amount:\s*)([A-Za-z0-9\-]+)").Value

-> EMI= System.Text.RegularExpressions.Regex.Match(str_Text,"(?<=EMI.*:\s*)([A-Za-z0-9\-]+)").Value

β†’ Add Data Row

ArrayRow-> {AccNumber,Bank,Branch,LoanTaken,Amount,EMI}
DataTable-> dt_Output

β†’ Write Range Workbook
Output:

Workflow:

xaml:
Sequence28.xaml (14.1 KB)

Regards

2 Likes

If you have that data in notepad it means it’s a text file, so just use the Read Text File activity.

From given sample we assume that the data is within a key value structure, where : is a delimiter
So with some cleansings we can do

  • Dictionary creation

OR

  • parsing it within a KeyValue Structure DataTable with generate DataTable
  • Read CSV (when replacing : to another delimiter with Replace Method, done before)
    PLUS / Optional transponation to a ColName, ColValue Table

OR

  • using a generic Regex and transforming the result e.g. to another prefered structure / DataType:

grafik
Refering to the groups for Key, Value extraction from a match
grafik

1 Like

Thanks for you help

does we can’t able do with out using regex?

Hi @jayanthi_bureddy

As per your requirement it is good to go with regex expressions.

Regards

1 Like

Ok ,thanks for the help
it really helps me

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.