Processing text document

Hi, I am fairly new to UI Path so thank you in advance for your help, I need to write a sequence which will read and amend a text file (specifically .V21), the file has nearly 150 thousand columns. I need to add ‘01’ to specific piece of text which is repeated throughout the document, lets call it ‘text A’, the number added will grow each time it finds ‘text A’ so it will add 01 then 02, 03 and so on every time it finds ‘text A’. But, also has to reset to 01 every time it finds ‘text B’ and start again. I am planning to use an int variable which will determine the number and be reset when ‘text B’ appears.

I basically have two questions,

  1. all the functionality related to processing excel files, lets say ‘for each row’ object, is there an equivalent for text documents, or can it be used all the same?
  2. it’s probably an easy sequence to write for the pros, but not for me yet, can you recommend any tutorials or other materials that can help me get this done?

Many Thanks


You can use DataTable then use For Each Row to get the particular text. You can also combine it with Regex if the text is in specific pattern. You may find the detail explanation in .

In any kind of programming language, trial and error is the best training.

Hope it helps.

So the problem is that text file is very randomly spaced, for instance no specific columns, but I managed to change it to data.table, then export it as csv, and manually copy the file to a text document, and it looks like it hasn’t changed the actual text doc, so hopefully any alterations to it that I will try to do won’t re-structure the text file. Anyway, thank you for the quick response!