cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TerryS
New Member

Replace Text - Based on Excel Sheet

Hi All,

 

New user of power automate.

 

I am writing a process that opens a text file and replaces text based on an excel sheet. Basically any text in Column A, should be replaced with text in Column B. The process does not error, but do not think it is doing anything below the For each loop.

 

PowerAutomate1.png

 

 

Any guidance would be gratefully received.

 

Terry 

4 REPLIES 4
Nived_Nambiar
Resolver III
Resolver III

Hi @TerryS 

 

Did the below process is one you need to do,

 

you had a text file which contains column A values of excel sheet (not all values , only some). Now you need to replace the column A values in text file with the given column B values (in same row of excel sheet), this is what u need to do , right?

 

Regards,

Nived N

amamidwar23
Advocate I
Advocate I

hi @TerryS 

 

You're for loop seems not as you want.

Exceldata is a datable and your currentitem is a column , so iterate through each cell of your Currentitem and then use replace action 

or else Do this:- 

1)Search for each keyword in your text file, then

2)check if it is available in Column A using for loop (iterating through each cell in the column)

3)  if it is found, get the row no and then use your replace action and mention column B with row no.

 

PAD does not have enough excel actions to work, but you can use 4 line VBA code to achieve this. 

 

Thanks 

AR

Please consider marking my post as a solution! to guide others, if this helps.

 

 

 

ShanKM
Helper I
Helper I

Hi @TerryS ,

 

try in this way, this is the easiest method to implement. 

text replacetext replace

 

Thanks,

Shan KM

Ahammad_Riyaz
Super User
Super User

Hi @TerryS 

 

In for each u hav to mention just read excel output variable.

i think u hav to mention currentitem in foreach loop

currentitem[0] , currentitem[1]

Thanks

Ahammad Riyaz

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,093)