Read file Txt

string

#1

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


#2

Use Indexof,Substring and assign result to a varible


#3

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


#4

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


Extract String from Text file
#5

@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!


#6

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


#7

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

image