Read file Txt

hello, I wanted to extract some data from a txt to be able to paste them into another file.

Use Indexof,Substring and assign result to a varible

On the academy2 advanced training (using ReFramwork) you have an exercice and its walkthough which is solving similar problem (extracting adjacent values from string)

You should have a look into it.

Cheers

Hi @sebasmc07,

Use Matches activity

First Value:
Use Matches activity
Properties
Input : YourInputString
Pattern : ((?<=DE FACTURA:).*(?=FECHA:))
Result: iEnumResult ->IEnumberable
after that use assign activity to get the data
strFirst=iEnumResult (0).ToString()

Second Value:
Use Matches activity
Properties
Input : YourInputString
Pattern : ((?<=Para:).*(?=Enviar))
Result: iEnumResult ->IEnumberable
after that use assign activity to get the data
strSecond=iEnumResult (0).ToString()

Third Value:
Use Matches activity
Properties
Input : YourInputString
Pattern : ((?<=SUBTOTAL:).*(?=RETENCION))
Result: iEnumResult ->IEnumberable
after that use assign activity to get the data
strThird=iEnumResult (0).ToString()

Regards,
Arivu

@sebasmc07: This link will be very helpful for you in the forum along the way.

Your post is a question on how to achieve something, please remember to mark the right categories and tags when posting.

Happy Automating!

1 Like

Use “Get Text” activity to fetch character/number/anything and use indexOf and substring methods.

error
2nd-copy (1).xaml (8.5 KB)

image