Pick some data in txt to xlsx

Hi, can i know how to pick some data in txt to xlsx? please give example and what activities should i use after read both of it.
example:
(in txt) my name is ahmad
(in xlsx) Name: <“name”>

output:
(in xlsx) Name: ahmad

  1. Read your name into string. Use “Read Text File” Activity. The output of this activity will be saved to string variable.

https://activities.uipath.com/docs/read-text-file

  1. If you want to write in an existing file.
    Under Excel Application Scope Activity, use Write Cell Activity to write the name into Excel Sheet.

Pass the required inputs for this activity. Sheet Name, Range and the value (string variable read from the step 1)

Regards,
Karthik Byggari

1 Like

for the last step, i only need certain data(in txt) to overwrite/exchange with the data in xlsx

example:
(in txt) my name is ahmad
(in xlsx) Name: <“name”>

output:
(same xlsx) Name: ahmad

so, the string mynameisahmad… but i only want that “ahmad”

do i need to use invoke code?

No. You don’t need to use that

After reading the file, extract only the name from the string.

For example, myName = “my name is ahmad”

Split the string by space and take the last array item.

Regards,
Karthik Byggari

hi sir, can u explain more about split the string or give some illustration? sorry im really new with RPA

you may do it simply:
Name = myName.Split(chr(32)).ToList()(3)